List your android application to Open_with Intent.
Edit your AndroidManifest file with blow intent inside activity tag.
<activity
android:name=".MyActivity"
android:label="@string/title_activity_main">
<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.VIEW"/>
<category android:name="android.intent.category.DEFAULT"
/>
<data android:mimeType="audio/*" />
</intent-filter>
</activity>
Then in your activity class use below mentioned code:
public
void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent intent = getIntent();
String action = intent.getAction();
String type = intent.getType();
if(action != null
&&
type != null){
Uri url =
(Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM);
// write your code
}
}