Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8987279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:45:03+00:00 2026-06-15T21:45:03+00:00

I need to receive a broadcast event inside a broadcast receiver and than pass

  • 0

I need to receive a broadcast event inside a broadcast receiver and than pass this information to an activity that is already open. How can I inform the activity from the broadcast receiver without it getting recreated? This causes a total refresh which is not needed.

Now I could receive intent inside a broadcast receiver that is declared within the activity, but I also need to receive the intent when its in background as well, hence the main place I am processing the intents is in a separate broadcast receiver. So I just don’t know how to inform the activity that a new intent has arrived without onCreate() getting called and re-init the whole UI.

I think I need the NEW_TASK flag or it won’t run.

PS: What are these insane downvotes about. What could be more relevant than how to start an activity from a broadcast receiver in such a way as not to recreate the activity. BTW, I am going to find an answer w/wo you. Why the bitter downvotes? I suspect it is because you know I could use an answer. Well I’ll probably be posting an answer to this great question myself quite soon.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:45:04+00:00Added an answer on June 15, 2026 at 9:45 pm

    if you want to recreate this activity do this:

    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    

    if don’t want to recreate , just do this:

    • while this activity on your task’s top,intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
    • declare the actvity in the manifest with: android:lauchMode= "singleTask";
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I get a wallpaper changed event in a broadcast receiver? I need to
Hey I am working on app that need to pass variable receive from broadcastreceiver
I need some help to understand when I can expect my broadcast receiver will
I need to receive a GTK+ focus in event on a Terminal (VTE), but
I need the equivalent of git post-receive hook in Mercurial so I can notify
I am writing a small program that sends and receive multicast packets.I need to
I have to write a simple mobile application that is able to receive broadcast
I have registered incomingCall broadcast receiver, and it works fine, but I need receiver
I originally registered my broadcast receiver in my main Activity via code. However, I
So I have a broadcast receiver that needs to notify a service that it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.