Zcy.Yang Zcy.Yang - 3 months ago 63
Android Question

Permission Denial: starting Intent not exported from uid

I came to this problem when I open an app which already installed in my phone from my own app .


Permission Denial: starting Intent { act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER]
cmp=com.qq.reader/.widget.picbrowser.PictureActivity } from
ProcessRecord{3823559b 16851:com.pax.market.android.app/u0a322}
(pid=16851, uid=10322) not exported from uid 10324


public static void openApp(Activity activity,String packageName) {
PackageInfo pi;
try {
pi = activity.getPackageManager().getPackageInfo(packageName, 0);
Intent resolveIntent = new Intent(Intent.ACTION_MAIN, null);
resolveIntent.setPackage(pi.packageName);
PackageManager pManager = activity.getPackageManager();
List apps = pManager.queryIntentActivities(
resolveIntent, 0);

ResolveInfo ri = (ResolveInfo) apps.iterator().next();
if (ri != null) {
packageName = ri.activityInfo.packageName;
String className = ri.activityInfo.name;
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
ComponentName cn = new ComponentName(packageName, className);
intent.setComponent(cn);
activity.startActivity(intent);
}
} catch (NameNotFoundException e) {
Log.e(TAG, "Package Name not found: " + e.getMessage() + ", App is not installed.");
} catch (SecurityException e){
SnackBar.newBuilder().activity(activity).
text(activity.getString(R.string.permission_denied_to_open))
.build().show();
}
}


`

Rah Rah
Answer

did u tried adding

android:exported="true"

in android manifest else please show your code