IntentPlayground start activities for result

Test: Manual
Change-Id: I3004e6dd76c026e41d2c9a28f4dd59664f99cd09
This commit is contained in:
Liam Clark
2019-01-07 11:28:23 -08:00
parent 5e9e4f94aa
commit ba9b6ca212
8 changed files with 70 additions and 88 deletions

View File

@@ -16,6 +16,7 @@
package com.example.android.intentplayground;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
@@ -74,7 +75,9 @@ public class LaunchFragment extends Fragment {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.app_bar_launch && mOnLaunchCallback != null) {
mOnLaunchCallback.launchActivity(mIntentBuilderView.currentIntent());
Intent intent = mIntentBuilderView.currentIntent();
boolean forResult = mIntentBuilderView.startForResult();
mOnLaunchCallback.launchActivity(mIntentBuilderView.currentIntent(), forResult);
}
return super.onOptionsItemSelected(item);