-1

I have an Activity A (main Activity) that is called from an BroadCasterReciever B when device reboot

Intent i = new Intent (context,activityA.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);

I'd like to do something like that in Activity A:

protected void onCreate(Bundle savedInstanceState) {
    if (called from B) {
    } else {
    }
}

putExtra and getExtra doesn't work

K Neeraj Lal
  • 6,768
  • 3
  • 24
  • 33

1 Answers1

-1

Store data in sharedpref and check called from broadcast or normal

Android Shared preferences example

Community
  • 1
  • 1
Yogesh Rathi
  • 6,331
  • 4
  • 51
  • 81