Issue
I want to open the play store from app. It's fine in Samsung, but it failed in OnePlus mobile. I don't know where does the alibaba come from. It's strange.
Exception java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.VIEW dat=http://play.google.com/... cmp=com.alibaba.intl.android.apps.poseidon/com.alibaba.android.intl.weex.activity.WeexPageActivity } from ProcessRecord{a1dd30c 15827:a2bliving.ie.a2b/u0a151} (pid=15827, uid=10151) not exported from uid 10156
Code:
private static final String PLAY_STORE_LINK = "http://play.google.com/store/apps/details?id=%s&hl=en";
public void openUpdateLink() {
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(getExternalAppLink())));
}
public String getExternalAppLink() {
return String.format(PLAY_STORE_LINK, context.getPackageName());
}
Solution
You need to set android:exported="true"
in your AndroidManifest.xml file
<activity
android:name="com.anurag.example.MainActivity"
android:label="Demo"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" >
</action>
</intent-filter>
</activity>
Answered By - Anurag Aggarwal
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.