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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:18:49+00:00 2026-05-27T22:18:49+00:00

This is my sistuation A1 = Splash Screen Activity A2 = Main Activity A3

  • 0

This is my sistuation

A1 = Splash Screen Activity

A2 = Main Activity

A3 = Extra Activity

S1 = GPS Service

I start with A1 that creates intent to launch A2 and then A1 finish.
Inside A2 I create and bind S1 (Inside S1 I make a Notification)

CharSequence text = getText(R.string.local_service_started);

Notification notification = new Notification(R.drawable.notify_icon, text, System.currentTimeMillis());

Intent i = new Intent();
i.setClassName("xxx.yyy.zzz.kkk", "xxx.yyy.zzz.kkk.A2");
i.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);

PendingIntent contentIntent = PendingIntent.getActivity(this, 0, i, PendingIntent.FLAG_UPDATE_CURRENT);

notification.setLatestEventInfo(this, getText(R.string.local_service_label), text, contentIntent);
mNM.notify(NOTIFICATION, notification);

Now I have my icon in the notification bar
If I press HOME button inside my A2 activity and open another application and then I press my notification icon all is working correctly and I gate back my A2 activity(A2 is the top most activity), but if inside A2 I launch A3 and go back HOME and press the notification I have the problems, A2 is created as a new instance(A2 now isn’t top most)! Is possible to have the effect like long press HOME and focus the last open activity inside my application? I don’t want to open a specific activity, but bring to front my paused activity without a new instance of the activity.

  • 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-27T22:18:49+00:00Added an answer on May 27, 2026 at 10:18 pm

    I have solved, this open my application preserving the actual state and get the opened activity back form background to foregraund. Do the same think of app selecting from RECENTS !

    Intent i = new Intent();
    i.setAction(Intent.ACTION_MAIN);
    i.addCategory(Intent.CATEGORY_LAUNCHER);
    i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY);
    i.setComponent(new ComponentName(getApplicationContext().getPackageName(), MyAppClass.class.getName()));
    

    MyAppClass is the 1st Activity your APK is launching.

    Best regards

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is not a real situation; please ignore legal issues that you might think
I have this situation that when AbstractMethod method is invoked from ImplementClass I want
I have this situation that I need to let users define decisions based on
I have an object array that is being passed and then split up into
I have this situation where on my main page, there are different fields and
( Note that this situation isn't exactly how it is, but I made this
I've set up a parser that is consuming an asmx web service, and .NET
This situation arises from someone wanting to create their own pages in their web
In this situation I am trying to perform a data import from an XML
In this situation I have two models, Comment and Score. The relationship is defined

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.