I'm developing an app that opens other apps with intents and it works perfectly, but now i need to open a specific activity (or part of the app) and i don't know if it's even possible.
In this case i want to open Street View from the Google Cardboard app. I can't figure out or find the way of doing it.
Here is the intent im using (that works but does not full fill the task):
public void actionOpenCardboard(View view) {
Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.google.samples.apps.cardboarddemo");
if (launchIntent != null) {
startActivity(launchIntent);
}
}
You can launch the Activity
this way:
Intent intent = new Intent();
intent.setComponent(new ComponentName("com.example", "com.example.MyExampleActivity"));
startActivity(intent);
Also, you may need to add android:exported="true"
to the Activity
's manifest from which you are invoking the above code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With