4

我用它URI来搜索Play Store,但Android 文档没有提到搜索特定类别(如游戏、音乐或书籍)的方法。

URI marketUri = Uri.parse("market://search?q= ");

Play BooksPlay Music应用程序都将 Play Store 应用程序打开到正确的类别,所以如果它们可以打开到特定的类别,那么我想我可以搜索一个。有没有人有一些关于这样做的信息?

4

2 回答 2

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);
}
于 2012-05-11T04:52:19.670 回答
1

我在 play.google.com 的图书类别中进行了搜索,URL 如下所示:

https://play.google.com/store/search?q=android&c=books

尝试在查询后添加“&c=books”,看看会发生什么。

于 2012-05-02T23:32:24.773 回答