I have written a code to list all the installed apps. I have a button event which will be redirected to the particular App home page in the Google Store. However I am unable to successfully redirect them. Here is the code I have employed. I am not getting the app's package name in the uri and hence I am getting "URL not found on the server". Kindly drop in your valuable suggestions.
public void update(View view) {
Context context = this;
Uri uri = Uri.parse("http://play.google.com/store/apps/details?id=" + context.getPackageName());
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
// To count with Play market backstack, After pressing back button,
// to taken back to our application, we need to add following flags to intent.
try {
startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("http://play.google.com/store/apps/details?id=" + context.getPackageName())));
}
}
Thanks in advance