What I am trying to do is that the numbers to which my application sends messages to, are passed to the BraodcastReceiver...but so far either I am getting null or BroadcastR
Following @Jason 's example...I did this...
In MainActivity or any activity from where you want to send intent from
Intent intent = new Intent("my.action.string");
intent.putExtra("extra", phoneNo); \\ phoneNo is the sent Number
sendBroadcast(intent);
and then in my SmsReceiver Class I did this
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
Log.i("Receiver", "Broadcast received: " + action);
if(action.equals("my.action.string")){
String state = intent.getExtras().getString("extra");
}
}
And in manifest.xml I added "my.action.string" though it was an option..
worked like charm!!