搜索特定的Play商店类别

adn*_*eal 4 android uri google-play

我用它URI来搜索Play商店,但Android文档没有提到搜索特定类别的方法,比如游戏,音乐或书籍.

URI marketUri = Uri.parse("market://search?q= ");
Run Code Online (Sandbox Code Playgroud)

Play图书播放音乐的应用程序都打开Play商店应用到正确的类别,因此,如果他们可以开到特定CATERGORY,那么我想我可以搜索一个.有没有人有这方面的信息?

adn*_*eal 6

我找到了解决方案.这是我用来购买音乐类别的当前方法.

public static void shopFor(Context context, String artistName) {
    String str = "https://market.android.com/search?q=%s&c=music&featured=MUSIC_STORE_SEARCH";
    Intent shopIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format(str, Uri.encode(artistName))));
    shopIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    shopIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
    context.startActivity(shopIntent);
}
Run Code Online (Sandbox Code Playgroud)