Skip to content Skip to sidebar Skip to footer

Adb Shell Am Broadcast - Broadcastreceiver Throws Nullpointer

I'm trying to launch this command: adb shell am broadcast -a android.provider.Telephony.SMS_RECEIVED --es sms_body 'TEXTTEXTTEXT' -n com.example.name/.receivers.SmsReceiver And

Solution 1:

Do you have any idea what I did wrong?

You are sending a broadcast with a string extra named sms_body. Your code is not using that. Your code is using a Serializable extra named pdus.

When I try to "simulate" this problem, I get this error.

Use the Emulator Control tab in DDMS, or perhaps the emulator console (e.g., telnet localhost 5554), to send simulated SMS messages to an emulator.

Or, move your SMS-processing logic into a Java class that you can test using JUnit.

Post a Comment for "Adb Shell Am Broadcast - Broadcastreceiver Throws Nullpointer"