Frage

I try to start an activity from another package, but it has not LAUNCHER category

Intent i = new Intent();            
i.setComponent(new ComponentName(maxVerPackageName, maxVerClassName));
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
startActivity(i);

I faced the Exception: "An exception occurred: java.lang.SecurityException"

what's wrong, please help?

War es hilfreich?

Lösung

The other activity is enforcing a permission. So that only apps that have the permission or same uid can launch the activity.

Edit: If you have written other app

then add this attribute to the other activity which you are trying to launch

android:exported="true"
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top