0

I want to redirect the user to the Google Play Store application from my app, and i want to open the collection of Editor's choice as a default activity of the play store app.

in Documentation(OpeningCollection), it says that if you want to open the Editor's choice collection you should use :

market://apps/collection/<collection_name>

I've tried this :

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://apps/collection/editors_choice"));
startActivity(intent);

But it doesn't work , it always give ActivityNotFoundException :

06-21 17:23:26.564: W/System.err(1820): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=market }
06-21 17:23:26.564: W/System.err(1820):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java)
06-21 17:23:26.564: W/System.err(1820):     at android.app.Instrumentation.execStartActivity(Instrumentation.java)
06-21 17:23:26.564: W/System.err(1820):     at android.app.Activity.startActivityForResult(Activity.java)
06-21 17:23:26.564: W/System.err(1820):     at android.app.Activity.startActivityForResult(Activity.java)
06-21 17:23:26.564: W/System.err(1820):     at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:817)
06-21 17:23:26.564: W/System.err(1820):     at android.app.Activity.startActivity(Activity.java)
06-21 17:23:26.564: W/System.err(1820):     at android.app.Activity.startActivity(Activity.java)
06-21 17:23:26.564: W/System.err(1820):     at com.icompagnon.activities.ApplicationsSpaceActivity.onClick(ApplicationsSpaceActivity.java:92)
06-21 17:23:26.564: W/System.err(1820):     at android.view.View.performClick(View.java)
06-21 17:23:26.564: W/System.err(1820):     at android.view.View$PerformClick.run(View.java)
06-21 17:23:26.564: W/System.err(1820):     at android.os.Handler.handleCallback(Handler.java)
06-21 17:23:26.564: W/System.err(1820):     at android.os.Handler.dispatchMessage(Handler.java)
06-21 17:23:26.564: W/System.err(1820):     at android.os.Looper.loop(Looper.java)
06-21 17:23:26.564: W/System.err(1820):     at android.app.ActivityThread.main(ActivityThread.java)
06-21 17:23:26.564: W/System.err(1820):     at java.lang.reflect.Method.invokeNative(Native Method)
06-21 17:23:26.564: W/System.err(1820):     at java.lang.reflect.Method.invoke(Method.java)
06-21 17:23:26.564: W/System.err(1820):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
06-21 17:23:26.564: W/System.err(1820):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
06-21 17:23:26.564: W/System.err(1820):     at dalvik.system.NativeStart.main(Native Method)

When i try to open the details of some application it works ( example : google-maps app):

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=com.google.android.apps.maps"));
startActivity(intent);

But when i try to open the editor's choice activity , it returns exception. Is this an issue in Android ??

5
  • What is "the editor's choice activity"? How have you tried to open it? We will also need the stack trace to be able to assist you much further. Commented Jun 21, 2013 at 16:17
  • the code in my question is what i'm using to launch google play , refer the docs that i've putted in my question : developer.android.com/distribute/googleplay/promote/…
    – Houcine
    Commented Jun 21, 2013 at 16:19
  • 1
    We still need the stack trace to be able to assist you much further. Commented Jun 21, 2013 at 16:22
  • @CommonsWare suggested stack trace will be handy..
    – CRUSADER
    Commented Jun 21, 2013 at 16:24
  • see my edits for the stack trace ,
    – Houcine
    Commented Jun 21, 2013 at 16:24

1 Answer 1

1

Your copy of the Play Store does not support market://apps/collection/editors_choice.

You might try the alternative (http://play.google.com/store/apps/collection/editors_choice) to see whether the Play Store comes up as an available option. If it does, then that would suggest a documentation bug, and there's some different syntax for the market:// version of that Uri. If the Play Store does not come up as an option, that would suggest that your edition of the Play Store perhaps pre-dates the addition of support for those Uri structures.

5
  • did you tried it on your device?? i've tried in my HTC ONE X with Jelly Bean 4.1.1 , and in Samsung Galaxy S III with ICS 4.0.3 and it doens't work . it looks like a documentation bug ?
    – Houcine
    Commented Jun 21, 2013 at 16:42
  • when i've tried the alternative, the Play Store comes up as an Available option. so can we say that would be a documentation bug ?
    – Houcine
    Commented Jun 21, 2013 at 16:45
  • 1
    @Houcine: Yes. I just downloaded ManifestViewer (play.google.com/store/apps/…) and examined the Play Store manifest. The activity that supports http://play.google.com/store URLs only supports market://search URLs. There is another activity that supports market://details, and that's all I see in the market: scheme. So, the documentation is out of sync with the current version of the Play Store, it seems. Commented Jun 21, 2013 at 16:51
  • Thanks , that's it. and +1 for the app ManifestViewer ;-)
    – Houcine
    Commented Jun 21, 2013 at 17:07
  • @Houcine: I used to use another app for inspecting the manifest, but they dropped that feature. Up until today, I had not yet found an alternative. Your question led me to try again, where I found ManifestViewer. So, thank you for spurring me to find it! :-) Commented Jun 21, 2013 at 17:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.