Mar*_*kus 0 android uri android-intent deezer android-implicit-intent
我正在尝试通过发送以下意图对 Deezer 进行搜索:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.deezer.com/search/" + query));
this.startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
在以前的版本中,Web 浏览器打开时带有一个链接,上面写着“在 Deezer 中打开”(或类似内容)。但在当前版本中,这不再起作用。
有没有办法打开 Deezer 应用程序并执行搜索?我已经尝试了以下(没有成功):
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("deezer://search/" + query));
this.startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
您可以使用许多深层链接在 Deezer 应用程序中搜索内容。你确实有这样的基本搜索:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("deezer://www.deezer.com/search/" + query));
this.startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
但你也可以更精确:
// Search for an artist, will display the best match
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("deezer-query://www.deezer.com/artist?query" + query));
this.startActivity(intent);
// Search for an album, will display the best match
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("deezer-query://www.deezer.com/album?query" + query));
this.startActivity(intent);
// Search for a track, will display the best match
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("deezer-query://www.deezer.com/track?query" + query));
this.startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
651 次 |
| 最近记录: |