Add the current platform easter egg to the picker

It turns out to be very useful when debugging ActivityView.

Test: this is the test
Change-Id: I97274f28be2e83dd92f9bcb4e87efb099cc0cedc
This commit is contained in:
Dan Sandler
2018-12-07 16:09:38 -05:00
committed by Daniel Sandler
parent ff709020ab
commit 787d064df5

View File

@@ -20,6 +20,7 @@ import android.app.Activity;
import android.app.ActivityView;
import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;
import android.widget.Button;
public class ActivityViewActivity extends Activity {
@@ -41,6 +42,10 @@ public class ActivityViewActivity extends Activity {
final Intent intent = Intent.makeMainActivity(null);
final Intent chooser = Intent.createChooser(intent,
"Pick an app to launch in ActivityView");
chooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Parcelable[] {
new Intent(Intent.ACTION_MAIN)
.addCategory("com.android.internal.category.PLATLOGO")
});
if (intent.resolveActivity(getPackageManager()) != null) {
chooser.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_MULTIPLE_TASK);