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 7702475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:14:08+00:00 2026-05-31T23:14:08+00:00

If my procedure is following: Launch Activity A -> Activity B Press ‘Home’ button.

  • 0

If my procedure is following:

  1. Launch Activity A -> Activity B
  2. Press ‘Home’ button.
  3. Click on the application again.

Result: ‘Activity B’ shows up (it resumes).

  1. Launch Activity A -> Activity B
  2. Press ‘Back’ button.
  3. Click on the application again.

Result: ‘Activity A’ shows up (it restarts).

I want to do exactly same from the BroadcastReceiver.

  1. Launch Activity A -> Activity B
  2. Press ‘Home’ button.
  3. BroadcastReceiver receives a broadcast and want to “resume” application.

My expected result: ‘Activity B’ shows up.

I want to do exactly same from the BroadcastReceiver.

  1. Launch Activity A -> Activity B
  2. Press ‘Back’ button.
  3. BroadcastReceiver receives a broadcast and want to “restart” application.

Current result: ‘Activity A’ shows up.

Following code doesn’t do what I expect:

public void onReceive(Context context, Intent intent) {
        Intent i = new Intent(context, ActivityA.class);
        i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(i);
    }

I also tried “Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY” but no luck.

  • 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-05-31T23:14:09+00:00Added an answer on May 31, 2026 at 11:14 pm

    My gosh, I made it working!!

    Thank you for other answers you guys provided, but they weren’t what I was looking for.

    This will do the job:

    Intent i = getPackageManager().getLaunchIntentForPackage("com.your.package.name");
    i.setFlags(0);
    i.setPackage(null);
    startActivity(i);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am willing to add a button in my application which on-click will restart
Given the following procedure call which returns an application-managed unique integer: DECLARE @id as
In my Application I use the following procedure to recursively scan any folder and
I want to write the following procedure / function: procedure ShowSysPopup(aFile: string; x, y:
I have a modal dialog that is created with the following: procedure TFormCompose.createParams(var Params:
With the following Stored Procedure in SQL Server 2005 IF OBJECT_ID('[dbo].[UserProfile]') IS NOT NULL
I am running the following stored procedure to delete large number of records. I
I use the following mysql procedure, DROP PROCEDURE IF EXISTS `allied`.`GetRegistrationData`$$ CREATE DEFINER=`allied`@`%` PROCEDURE
I have the following stored procedure which will generate mon to sun and then
When I try to install redmine by following the procedure here: http://www.redmine.org/projects/redmine/wiki/RedmineInstall At step

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.