Receiving Android Google Play Music broadcast twice -
i hope you're having day :)
let's point... in manifest file have added receiver :
<receiver android:name="com.example.app.androidmusicbroadcastreceiver" android:exported="false"> <intent-filter> <action android:name="com.android.music.metachanged" /> </intent-filter> </receiver>
i've created class com.example.app.androidmusicbroadcastreceiver .
public class androidmusicbroadcastreceiver extends broadcastreceiver { public androidmusicbroadcastreceiver() { // todo auto-generated constructor stub } @override public void onreceive(context arg0, intent arg1) { log.v("myapp","artist : "+arg1.getstringextra("artist")); log.v("myapp","song : "+arg1.getstringextra("track")); } }
and works... reason log thing happens twice in row every time song changes. :
how come ? right assume option if want use information (artist, track) later, save in file somewhere ?
Comments
Post a Comment