Issue
i asked a question on how should i open the playstore page using an app link on my app. i got an answer to use "market://details?id=" + appPackageName to open the play store app but instead of opening the playstore page its re opening my app. whats the fix?
enter code here
protected void Updateclick(View view) {
String appPackageName="io.kodular.samithuaz.smartQ";
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
}
Solution
Try this.You need to specify proper store URI for the different stores. take reference link
protected void Updateclick(View view) {
final String appPackageName = getPackageName();
try {
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("market://details?id=" + appPackageName)));
} catch (android.content.ActivityNotFoundException anfe) {
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName)));
}
}
Answered By - Sandesh KhutalSaheb
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.