Example usage for android.app ActivityManager START_CANCELED

List of usage examples for android.app ActivityManager START_CANCELED

Introduction

In this page you can find the example usage for android.app ActivityManager START_CANCELED.

Prototype

int START_CANCELED

To view the source code for android.app ActivityManager START_CANCELED.

Click Source Link

Document

Result for IActivityManager.startActivity: an error where the start had to be canceled.

Usage

From source file:android.app.Activity.java

private void startIntentSenderForResultInner(IntentSender intent, int requestCode, Intent fillInIntent,
        int flagsMask, int flagsValues, Activity activity, Bundle options)
        throws IntentSender.SendIntentException {
    try {//from  w w  w  .j  ava  2s  . com
        String resolvedType = null;
        if (fillInIntent != null) {
            fillInIntent.migrateExtraStreamToClipData();
            fillInIntent.prepareToLeaveProcess();
            resolvedType = fillInIntent.resolveTypeIfNeeded(getContentResolver());
        }
        int result = ActivityManagerNative.getDefault().startActivityIntentSender(
                mMainThread.getApplicationThread(), intent, fillInIntent, resolvedType, mToken,
                activity.mEmbeddedID, requestCode, flagsMask, flagsValues, options);
        if (result == ActivityManager.START_CANCELED) {
            throw new IntentSender.SendIntentException();
        }
        Instrumentation.checkStartActivityResult(result, null);
    } catch (RemoteException e) {
    }
    if (requestCode >= 0) {
        // If this start is requesting a result, we can avoid making
        // the activity visible until the result is received.  Setting
        // this code during onCreate(Bundle savedInstanceState) or onResume() will keep the
        // activity hidden during this time, to avoid flickering.
        // This can only be done when a result is requested because
        // that guarantees we will get information back when the
        // activity is finished, no matter what happens to it.
        mStartedActivity = true;
    }
}