I am starting my old Activity by using Flags Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP but I cann't send String to this Activity by using putExtra:
Intent intent = new Intent(INTENT_ActivityA);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.putExtra("DATA", "OK");
startActivity(intent);
in the onResume getIntent().getStringExtra("DATA")==null
How to send data to the running Activity?
If you override onNewIntent i think you should be having your data in it. Try following
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
intent.getStringExtra("DATA");
}
Hope it helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With