【问题标题】:Add own app to the whatsapp audio selection将自己的应用程序添加到 whatsapp 音频选择
【发布时间】:2019-04-25 10:55:36
【问题描述】:

如何将我自己的应用添加到 android(使用 java)中的 this application 之类的 whatsapp 音频选择中?

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

我尝试使用此应用清单中的一对一意图过滤器,但没有成功。

感谢语法更正;)

【问题讨论】:

    标签: java android android-intent whatsapp intentfilter


    【解决方案1】:

    在whatsapp(如应用程序)中,在音频选择上这样做

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

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

    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 中选择音频或根据您的需要发送到其他应用程序。

    【讨论】:

      【解决方案2】:
          <intent-filter>
      <action android:name="android.intent.action.VIEW" />
      <category android:name="android.intent.category.DEFAULT" />
      <data android:scheme="content"/>
      <data android:host="media"/>
      <data android:mimeType="audio/*"/>
      <data android:mimeType="application/ogg"/>
      <data android:mimeType="application/x-ogg"/>
      <data android:mimeType="application/itunes"/>
      </intent-filter>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-08-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多