Forum Discussion

sebrk's avatar
sebrk
Explorer
2 years ago
Solved

Starting another application using intents

I've implemented a native Android plugin that I call from Unity C# script to start another application using an intent like so:

Intent launchIntent = context.getPackageManager().getLaunchIntentForPackage(packageName);
if (launchIntent != null) {
Log.d(TAG, "Launching package: " + packageName);
context.startActivity(launchIntent);
} else {
Log.e(TAG, "Package not found: " + packageName);
}

Regardless of package name, it is never found (I can verify that the package indeed is installed and is listed using 'pm list packages' using adb shell. This makes me believe Meta has restricted the use of intents to start other installed applications? 

Seeing the developer documentation is pretty much toilet in general I wonder if anyone knows if this is even possible? I do find some posts suggesting it at least has worked in the past but I cannot get this to work. Anyone knows?

 

1 Reply