2017-06-06 1 views
0

Quel est le IntentFilter que je dois utiliser pour que mon application soit reconnue comme ayant l'audio à partager? WhatsApp ne liste pas mon application quand même ...Quel est le IntentFilter qui fait que mon application soit reconnue comme ayant du son à partager?

Comme ceci: enter image description here

J'ai déjà essayé:

<intent-filter> 
       <action android:name="android.intent.action.SEND" /> 
       <data android:mimeType="audio/*" /> 
</intent-filter> 

<intent-filter> 
       <action android:name="android.intent.action.VIEW" /> 
       <data android:mimeType="audio/*" /> 
</intent-filter> 

et trop

<activity 
     android:name=".activities.MyActivity" 
     android:exported="true"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

     <category android:name="android.intent.category.LAUNCHER" /> 
    </intent-filter> 
    <intent-filter> 
     <action android:name="android.intent.action.PICK" /> 
     <category android:name="android.intent.category.DEFAULT" /> 
     <data android:mimeType="audio/*" /> 
    </intent-filter> 
    <intent-filter> 
     <action android:name="android.intent.action.GET_CONTENT" /> 
     <category android:name="android.intent.category.OPENABLE" /> 
     <category android:name="android.intent.category.DEFAULT" /> 
     <data android:mimeType="audio/*" /> 
    </intent-filter> 
</activity> 

Mais rien ne semble fonctionner ...

Quelqu'un sait?

Thx

+0

pourquoi avez-vous utilisé plusieurs les combiner. –

Répondre

0

Je ne sais pas si vous êtes à la recherche pour cela, mais essayez d'utiliser l'audio mimeType:

<intent-filter> 
    <action android:name="android.intent.action.SEND" /> 
    <category android:name="android.intent.category.DEFAULT"/> 
    <data android:mimeType="audio/*" /> 
</intent-filter> 

Pour plus d'informations, visitez Android Intent-Filter Doc

+0

N'a pas fonctionné aussi, mais thx de toute façon. – EmilyR

0

Ajouter ce dans le manifeste: -

<intent-filter . . . > 

<action android:name="android.intent.action.SEND" /> 
<category android:name="android.intent.category.DEFAULT" /> 

<action android:name="com.example.project.SHOW_CURRENT" /> 
<action android:name="com.example.project.SHOW_RECENT" /> 
<action android:name="com.example.project.SHOW_PENDING" /> 

<category android:name="android.intent.category.DEFAULT" /> 
<data android:mimeType="audio/*" /> 
. . . 
</intent-filter> 

combiné Combiner tous les <intent-filter . . . > J'espère que cela devrait fonctionner, d'ailleurs vous pouvez suivre ce guide Guide link

+0

Rien :(Une autre idée? – EmilyR

+0

Je suis nouveau à ce sujet, je ne sais pas si je comprends ce que vous voulez dire, que voulez-vous dire par intention dans mon activité? Mon activité n'envoie aucune intention, elle veut recevoir une intention venant de whatsApp, afin d'offrir un son à partager via WhatsApp alors je dois utiliser un filtre d'intention.Je me trompe? – EmilyR

+1

Désolé ma mauvaise, se référer à ce https://stackoverflow.com/a/38799840/4762767 –