I have the following problem. I'm trying to send data from BroadcastReceiver to an activity.
in the onRecive () I have:
intent = new Intent(context, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("valorPasar",dato);
context.startActivity(intent);
in the activity I have the following:
I'm trying to read the data variable (which is sent from the broadcastreceiver) sent inside (and capture it in the activity inside) onLocationChanged (Location location)
Public void onLocationCHanged (Location location){
Intent intent = new Intent();
String mensaje = intent.getStringExtra("valorPasar")
}
The problem is that the message variable does not load the value of "Passe value" defined in the Broadcastreceiver