I am trying to catch an NFC tag in a broadcast receiver, so I wrote a simple BR that prints "asd" in onReceive (). In the xml manifest, it is described like this:
and I get only this and donβt print at all ....
01-31 16:37:18.980: ERROR/MediaPlayer(990): setAudioStream called in state 8 01-31 16:37:18.980: ERROR/MediaPlayer(990): error (-38, 0) 01-31 16:37:18.980: ERROR/MediaPlayer(990): start called in state 0 01-31 16:37:18.980: ERROR/MediaPlayer(990): error (-38, 0) 01-31 16:37:18.988: ERROR/MediaPlayer(990): Error (-38,0)
When I use the operation to process the intent as follows:
<activity android:name="TagViewer" android:theme="@android:style/Theme.NoTitleBar"> <intent-filter> <action android:name="android.nfc.action.TAG_DISCOVERED"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> </activity>
The activity starts and works fine, so how can I get it to work with BroadcastReceiver?
z_z_z_z
source share