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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:19:51+00:00 2026-05-18T04:19:51+00:00

I have an activity Alert , which is defined in the manifest like so

  • 0

I have an activity Alert, which is defined in the manifest like so :

        <activity android:name="Alert"
              android:label="@string/app_name"
              android:theme="@android:style/Theme.Dialog"
              android:launchMode="singleInstance"
              android:noHistory="true">
    </activity>

I also have another activity Config which is a setting page for a homescreen widget and is defined as

        <activity android:name=".Config"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

The Alert activity is shown when the user clicks on the widget. Now my problem is that, after running the application and returning to Home screen, when I long press the home-key and select the app, the Alert activity is shown. Is there a way to prevent this from happening and always start from the Config 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-18T04:19:52+00:00Added an answer on May 18, 2026 at 4:19 am

    To illustrate this problem, you should understand the way Android handles activities. When you press ‘home’ button, your Alert is considered to be still alive, but it is in a pause mode. So, when you long press, it is switched back and just resume your previous top-of-the-pile activity, which is the Alert in this case.

    So, you may consider to, in your onPause event of Alert, to tell Android to end the Activity instead of putting it to pause.

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

Sidebar

Related Questions

I have Activity A with android:launchMode=singleTop in the manifest. If I go to Activity
I have an activity with style Dialog, containing two EditTexts. However, only the first
I have an alert dialog being popped, which allows a person to enter a
in my android app, I have a button that leads to an activity which
I have activity stack in my android application.Suppose A and B.When the application starts
I am having trouble with my activity management. So I have activity A which
I have an activity with a custom view which extends EditText in it. Usually
I have an Activity which loads a custom ImageView ( https://github.com/MikeOrtiz/TouchImageView/blob/master/src/com/example/touch/TouchImageView.java ). Inside onCreate,
I have this textbox in the other activity and a button which leads to
I am writing a simple android app which have a edittext and a button.

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.