Example usage for android.content ActivityNotFoundException printStackTrace

List of usage examples for android.content ActivityNotFoundException printStackTrace

Introduction

In this page you can find the example usage for android.content ActivityNotFoundException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:com.cognizant.trumobi.PersonaLauncher.java

@Override
public void startActivity(Intent intent) {
    // TODO Auto-generated method stub
    PersonaLog.d("PersonaLauncher", " -- startActivity ----");
    final ComponentName name = intent.getComponent();
    if (name != null) {
        PersonaLog.d("personalauncher", "updateCountersForPackage called from startactivity");
        updateCountersForPackage(name.getPackageName(), 0, 0, 0);
    }//from  w  ww  .j  a  v  a  2s .  c  om
    PersonaLog.d("personalauncher", "parameter passed is " + name.getPackageName());
    PersonaLog.d("personalauncher", "--------inside startactivity----- intent is " + intent.toString());
    try {
        super.startActivity(intent);
    } catch (ActivityNotFoundException e) {
        e.printStackTrace();
        Toast.makeText(this, getString(R.string.activity_not_found) + "123", Toast.LENGTH_SHORT).show();
    } catch (SecurityException e) {
        Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show();
        PersonaLog.e(LOG_TAG,
                "PersonaLauncher does not have the permission to launch " + intent
                        + ". Make sure to create a MAIN intent-filter for the corresponding activity "
                        + "or use the exported attribute for this activity.",
                e);
    }
}