I have a BroadcastReceiver
which launches a HomeActivity
with some information passed with the extras.
What happens when the activity is a
Make sure when you are launching the intent from the BroadcastReceiver you set the FLAG_ACTIVITY_SINGLE_TOP flag.
intent.addFlags (FLAG_ACTIVITY_SINGLE_TOP);
...
class HomeActivity extends Activity {
...
@Override
protected void onNewIntent(Intent intent) {
Bundle extras = intent.getExtras();
}
...
}
Just extending Cory Roy's answer you have to define "SingleTop" in AndroidManifest.xml too.
<activity
android:name="MainActivity"
android:launchMode="singleTop"
It seems that extending android.support.v7.app.ActionBarActivity this method does not work...