2

I hope you're having a good day :)

Let's get to the point... In my manifest file I have added a receiver like this :

<receiver android:name="com.example.app.AndroidMusicBroadcastReceiver" android:exported="false">
    <intent-filter>
        <action android:name="com.android.music.metachanged" />
    </intent-filter>
</receiver>

I've also created the 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 it works... But for some reason the Log thing happens twice in a row every time the song changes. Like this :

logcat

How come ? Also am I right to assume that my only option if I want to use this information (artist, track) later, is to save it in a file somewhere ?

Kara
  • 6,115
  • 16
  • 50
  • 57
geecko
  • 660
  • 1
  • 9
  • 22
  • 1
    Info is probably about start/stop therefore you have that info twice. If you intend to use this app for a while than record it to a file. – Marko Lazić May 19 '13 at 22:09
  • Mhh.. I should also point out that if I press the "Next" button, I only get the info once. Anyway.. No workaround ? – geecko May 19 '13 at 22:47

0 Answers0