문제

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?

도움이 되었습니까?

해결책

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"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top