Search code examples
androidbroadcastreceiverstart-activity

Start activity when the activity is open inside broadcast receiver


I am trying to open an activity inside broadcast receiver. I can do that through intent, but it will open that activity only one time until i have close that activity. How can i reopen activity when that is started from broadcast receiver?


Solution

  • You can use intent.flag_activity_clear_top for starting new activity or intent.flag_activity_reorder_to_front if activity is already running and bringing that activity to foreground.

    hope this helps.