Example usage for android.content Intent FLAG_ACTIVITY_FORWARD_RESULT

List of usage examples for android.content Intent FLAG_ACTIVITY_FORWARD_RESULT

Introduction

In this page you can find the example usage for android.content Intent FLAG_ACTIVITY_FORWARD_RESULT.

Prototype

int FLAG_ACTIVITY_FORWARD_RESULT

To view the source code for android.content Intent FLAG_ACTIVITY_FORWARD_RESULT.

Click Source Link

Document

If set and this intent is being used to launch a new activity from an existing one, then the reply target of the existing activity will be transferred to the new activity.

Usage

From source file:com.smoothsync.smoothsetup.MicroFragmentHostActivity.java

public static void launch(@NonNull Context context, @NonNull MicroFragment<?> microFragment) {
    Intent intent = new Intent(context, MicroFragmentHostActivity.class);
    Bundle nestedBundle = new Bundle();
    nestedBundle.putParcelable("MicroFragment", microFragment);
    intent.putExtra("org.dmfs.nestedExtras", nestedBundle);
    intent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
    context.startActivity(intent);/*w ww  . j av a 2 s . c  om*/
}

From source file:net.bither.fragment.hot.AddAddressHotOtherFragment.java

@Override
public void onClick(View v) {
    Intent intent = null;/* w  ww  .  ja v  a  2  s.  c o  m*/
    switch (v.getId()) {
    case R.id.btn_hdm:
        intent = new Intent(getActivity(), AddHotAddressHDMActivity.class);
        break;
    case R.id.btn_private_key:
        intent = new Intent(getActivity(), AddHotAddressPrivateKeyActivity.class);
        break;
    }
    if (intent == null) {
        return;
    }
    intent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
    getActivity().startActivity(intent);
    getActivity().finish();
    getActivity().overridePendingTransition(R.anim.activity_in_drop, R.anim.activity_out_back);
}

From source file:net.bither.fragment.cold.AddAddressColdOtherFragment.java

@Override
public void onClick(View v) {
    Intent intent = null;/* ww w .  ja  v a 2  s. co m*/
    switch (v.getId()) {
    case R.id.btn_hdm:
        if (AddressManager.isHDMKeychainLimit()) {
            DropdownMessage.showDropdownMessage(getActivity(), R.string.hdm_cold_seed_count_limit);
            return;
        }
        intent = new Intent(getActivity(), AddColdAddressHDMActivity.class);
        break;
    case R.id.btn_private_key:
        if (AddressManager.isPrivateLimit()) {
            DropdownMessage.showDropdownMessage(getActivity(), R.string.private_key_count_limit);
            return;
        }
        intent = new Intent(getActivity(), AddHotAddressPrivateKeyActivity.class);
        break;
    }
    if (intent == null) {
        return;
    }
    intent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
    getActivity().startActivity(intent);
    getActivity().finish();
    getActivity().overridePendingTransition(R.anim.activity_in_drop, R.anim.activity_out_back);
}

From source file:mobisocial.musubi.BootstrapActivity.java

/**
 * finishes the caller if bootstrapping is necessary
 * @param activity//from w  ww . j  a  v  a  2  s  .  co m
 * @return true if the bootstrap activity will be started
 */
public static boolean bootstrapIfNecessary(Activity activity) {
    if (sBootstrapped) {
        return false;
    }
    Intent intent = new Intent(activity, BootstrapActivity.class);
    intent.putExtra(EXTRA_ORIGINAL_INTENT, (Parcelable) activity.getIntent());
    intent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
    activity.startActivity(intent);
    activity.finish();
    return true;
}

From source file:com.mycelium.wallet.activity.send.SendMainActivity.java

public static void callMe(Activity currentActivity, UUID account, Long amountToSend, Address receivingAddress,
        boolean isColdStorage) {
    Intent intent = new Intent(currentActivity, SendMainActivity.class);
    intent.putExtra("account", account);
    intent.putExtra("amountToSend", amountToSend);
    intent.putExtra("receivingAddress", receivingAddress);
    intent.putExtra("isColdStorage", isColdStorage);
    intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
    currentActivity.startActivity(intent);
}

From source file:com.mycelium.wallet.activity.send.SendMainActivity.java

public static void callMe(Activity currentActivity, UUID account, BitcoinUri uri, boolean isColdStorage) {
    Intent intent = new Intent(currentActivity, SendMainActivity.class);
    intent.putExtra("account", account);
    intent.putExtra("amountToSend", uri.amount);
    intent.putExtra("receivingAddress", uri.address);
    intent.putExtra("transactionLabel", uri.label);
    intent.putExtra("isColdStorage", isColdStorage);
    intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
    currentActivity.startActivity(intent);
}

From source file:com.silentcircle.contacts.activities.ScContactDetailActivity.java

@Override
protected void onCreate(Bundle savedState) {
    super.onCreate(savedState);
    if (PhoneCapabilityTester.isUsingTwoPanes(this)) {
        // This activity must not be shown. We have to select the contact in the
        // PeopleActivity instead ==> Create a forward intent and finish
        final Intent originalIntent = getIntent();
        Intent intent = new Intent();
        intent.setAction(originalIntent.getAction());
        intent.setDataAndType(originalIntent.getData(), originalIntent.getType());

        // If we are launched from the outside, we should create a new task, because the user
        // can freely navigate the app (this is different from phones, where only the UP button
        // kicks the user into the full app)
        if (NavUtils.shouldUpRecreateTask(this, intent)) {
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK
                    | Intent.FLAG_ACTIVITY_TASK_ON_HOME);
        } else {/*from  w  w  w. j a  v a 2  s .  c om*/
            intent.setFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS | Intent.FLAG_ACTIVITY_FORWARD_RESULT
                    | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
        }

        intent.setClass(this, ScContactsMainActivity.class);
        startActivity(intent);
        finish();
        return;
    }

    setContentView(R.layout.contact_detail_activity);

    mContactDetailLayoutController = new ContactDetailLayoutController(this, savedState,
            getSupportFragmentManager(), null, findViewById(R.id.contact_detail_container),
            mContactDetailFragmentListener);

    // We want the UP affordance but no app icon.
    // Setting HOME_AS_UP, SHOW_TITLE and clearing SHOW_HOME does the trick.
    ActionBar actionBar = this.getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayOptions(ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_TITLE,
                ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME);
        actionBar.setTitle("");
    }

    Log.i(TAG, getIntent().getData().toString());
}

From source file:com.android.contacts.activities.ContactDetailActivity.java

/** @} */

@Override//from www . j  av a2  s.  co  m
protected void onCreate(Bundle savedState) {
    super.onCreate(savedState);
    LogUtils.i(TAG, "[onCreate][launch]start");
    ///M: Bug Fix for ALPS01022809,JE happens when click the favourite video to choose contact in tablet
    registerPHBReceiver();
    mIsActivitFinished = false;
    /** M: Bug Fix for ALPS00393950 @{ */
    boolean isUsingTwoPanes = PhoneCapabilityTester.isUsingTwoPanes(this);
    if (!isUsingTwoPanes) {
        SetIndicatorUtils.getInstance().registerReceiver(this);
    }
    /** @} */
    if (PhoneCapabilityTester.isUsingTwoPanes(this)) {
        // This activity must not be shown. We have to select the contact in the
        // PeopleActivity instead ==> Create a forward intent and finish
        final Intent originalIntent = getIntent();
        Intent intent = new Intent();
        intent.setAction(originalIntent.getAction());
        intent.setDataAndType(originalIntent.getData(), originalIntent.getType());

        // If we are launched from the outside, we should create a new task, because the user
        // can freely navigate the app (this is different from phones, where only the UP button
        // kicks the user into the full app)
        if (shouldUpRecreateTask(intent)) {
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
        } else {
            intent.setFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS | Intent.FLAG_ACTIVITY_FORWARD_RESULT
                    | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
        }
        intent.setClass(this, PeopleActivity.class);
        startActivity(intent);
        LogUtils.i(TAG, "onCreate(),Using Two Panes...finish Actiivity..");
        finish();
        return;
    }

    setContentView(R.layout.contact_detail_activity);

    mContactDetailLayoutController = new ContactDetailLayoutController(this, savedState, getFragmentManager(),
            null, findViewById(R.id.contact_detail_container), mContactDetailFragmentListener);

    // We want the UP affordance but no app icon.
    // Setting HOME_AS_UP, SHOW_TITLE and clearing SHOW_HOME does the trick.
    ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        ///@Modify for add Customer view{
        actionBar.setDisplayOptions(
                ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_CUSTOM,
                ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME
                        | ActionBar.DISPLAY_SHOW_CUSTOM);
        ///@}
        actionBar.setTitle("");
    }

    Log.i(TAG, getIntent().getData().toString());
    /** M: New Feature xxx @{ */
    //M:fix CR:ALPS00958663,disconnect to smartbook when contact screen happen JE
    if (getIntent() != null && getIntent().getData() != null) {
        mSimOrPhoneUri = getIntent().getData();
        Log.i(TAG, "mSimOrPhoneUri = " + mSimOrPhoneUri);
    } else {
        Log.e(TAG, "Get intent data error getIntent() = " + getIntent());
    }
    /// M: @ CT contacts detail history set listener{
    ExtensionManager.getInstance().getContactDetailEnhancementExtension().configActionBarExt(getActionBar(),
            ContactPluginDefault.COMMD_FOR_OP09);
    /// @}
    LogUtils.i(TAG, "[onCreate][launch]end");
}

From source file:com.ichi2.anki.StudyOptionsFragment.java

private void openReviewer() {
    Intent reviewer = new Intent(getActivity(), Reviewer.class);
    if (mFragmented) {
        startActivityForResult(reviewer, AnkiActivity.REQUEST_REVIEW);
    } else {/*from  w w w.j av a  2  s  .c  o m*/
        // Go to DeckPicker after studying when not tablet
        reviewer.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
        startActivity(reviewer);
        getActivity().finish();
    }
    animateLeft();
    getCol().startTimebox();
}

From source file:com.brq.wallet.activity.ScanActivity.java

@Override
public void onActivityResult(final int requestCode, final int resultCode, final Intent intent) {
    if (Activity.RESULT_CANCELED == resultCode) {
        finishError(R.string.cancelled, "");
        return;//  ww  w  . java2s  .co  m
    }

    //since it was not the handler, it can only be the scanner
    Preconditions.checkState(SCANNER_RESULT_CODE == requestCode);

    // If the last autofocus setting got saved in an extra-field, change the app settings accordingly
    int autoFocus = intent.getIntExtra("ENABLE_CONTINUOUS_FOCUS", -1);
    if (autoFocus != -1) {
        MbwManager.getInstance(this).setContinuousFocus(autoFocus == 1);
    }

    if (!isQRCode(intent)) {
        finishError(R.string.unrecognized_format, "");
        return;
    }

    String content = intent.getStringExtra("SCAN_RESULT").trim();
    // Get rid of any UTF-8 BOM marker. Those should not be present, but might have slipped in nonetheless,
    if (content.length() != 0 && content.charAt(0) == '\uFEFF')
        content = content.substring(1);

    // Call the stringHandler activity and pass its result to our caller
    Intent handlerIntent = StringHandlerActivity.getIntent(this, _stringHandleConfig, content);
    handlerIntent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
    this.startActivity(handlerIntent);

    // we are done here...
    this.finish();
}