gpt4 book ai didi

java - 将自己的应用程序添加到 Whatsapp 音频选择中

转载 作者:行者123 更新时间:2023-12-02 06:19:07 24 4
gpt4 key购买 nike

如何将我自己的应用程序添加到 Whatsapp 音频选择中,例如 this application在 android 中(使用 java)?

我知道,我问过this question已经但我没有得到有用的答案。我不认为它可以工作,但我发现了这个应用程序,它可以在我的 Android 手机(华为 VNC-L31/华为 P9 Lite,Android 7.0)上运行。 (Screenshot)

我使用此应用程序 list 中的一对一 Intent 过滤器进行了尝试,但没有成功。

感谢语法纠正;)

最佳答案

在whatsapp(如应用程序)中对音频选择执行此操作

Intent intent = new Intent();
intent.setType("audio/*");
intent.setAction(Intent.ACTION_PICK);
startActivityForResult(Intent.createChooser(intent,"Select Audio "), reqCode);

并在您的应用程序中创建一个包含音频列表的 Activity 。

AndroidManifest.xml中添加这样的代码

 <activity
android:name=".activity.AudioListActivity"
android:windowSoftInputMode="stateAlwaysHidden">

<intent-filter>
<action android:name="android.intent.action.PICK" />
<category android:name="android.intent.category.DEFAULT" />

<data android:mimeType="audio/*" />
</intent-filter>
</activity>

并在您的AudioListActivity return result中选择音频或根据您的需要连接到其他应用程序。

关于java - 将自己的应用程序添加到 Whatsapp 音频选择中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55847660/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com