Merge "Add intent fields when launching instant app." into pi-dev

This commit is contained in:
TreeHugger Robot
2018-03-07 00:59:20 +00:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 0 deletions

View File

@@ -147,7 +147,10 @@ public class InstantAppButtonsPreferenceController extends BasePreferenceControl
if (!TextUtils.isEmpty(mLaunchUri)) {
installButton.setVisibility(View.GONE);
final Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setPackage(mPackageName);
intent.setData(Uri.parse(mLaunchUri));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
launchButton.setOnClickListener(v -> mParent.startActivity(intent));
} else {
launchButton.setVisibility(View.GONE);