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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:37:54+00:00 2026-06-10T03:37:54+00:00

My application is in running mode[foreground] and user clicks on home button, which puts

  • 0

My application is in running mode[foreground] and user clicks on home button, which puts application to background[and still running]. I have alarm functionality in my application which fires up. I want is when my alarm goes off i want to bring my background running application in foreground and from last state in which it was.

    <application
            android:name="com.abc.android.state.management.MainEPGApp"
            android:icon="@drawable/icon"
            android:label="@string/app_name"
            android:largeHeap="true"
            android:logo="@drawable/app_logo" >
            <activity
                android:name=".SplashScreen"
                android:label="@string/app_name"
                android:launchMode="singleTop"
                android:screenOrientation="nosensor"
                android:theme="@style/Theme.Sherlock" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        <activity
                    android:name=".Starter"
                    android:configChanges="orientation|screenSize"
                    android:screenOrientation="behind"
                    android:launchMode="singleTop"
                    android:uiOptions="none"
                    android:windowSoftInputMode="adjustPan" />
</application>
  • 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-10T03:37:56+00:00Added an answer on June 10, 2026 at 3:37 am
    Intent intent = new Intent(context, MyRootActivity.class);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_SINGLE_TOP);
    startActivity(intent);
    

    You should use your starting or root activity for MyRootActivity.

    This will bring an existing task to the foreground without actually creating a new Activity. If your application is not running, it will create an instance of MyRootActivity and start it.

    EDIT

    I added Intent.FLAG_ACTIVITY_SINGLE_TOP to Intent to make it really work!

    Second EDIT

    There is another way to do this. You can simulate the “launching” of the app the same way that Android launches the app when the user selects it from the list of available apps. If the user starts an application that is already running, Android just brings the existing task to the foreground (which is what you want). Do it like this:

    Intent intent = new Intent(context, SplashScreen.class);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // You need this if starting
                                                    //  the activity from a service
    intent.setAction(Intent.ACTION_MAIN);
    intent.addCategory(Intent.CATEGORY_LAUNCHER);
    startActivity(intent);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Java application which is running as non root mode. My App
I have a rails application, running in development mode ( with a sqlite database
I have a PHP application running in iFrame mode. I am rendering an <fb:multi-friend-selector
I have a WPF application running in debug mode, and I would like to
I have site running rails application and resque workers running in production mode, on
I have a Classic-ASP application running in IIS 7 (integrated mode) that needs to
I have set Application does not run in background mode property key to YES
I have an application running in cluster mode (two nodes) under tomcat/Linux. Unfortunately I've
I'm debug-running a daemon application in foreground mode inside gdb inside a tmux session.
is there a way that an application running at user-mode can communicate with another

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.