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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:29:36+00:00 2026-06-07T22:29:36+00:00

Very strange thing here. I initially had an activity that was the start up

  • 0

Very strange thing here.

I initially had an activity that was the start up activity (Activity A). It had the tag android:launchMode="singleTask" associated with it. No problems. My requirements changed and now i’m making Activity B the startup activity. I copied the intent filter over, I changed the name to “.ActivityB” and I moved the launch mode tag over as well.

It seems to work okay; when I start the app I go to Activity B. However when I go from Activity B to Activity A and then click the back button the app exits and won’t reopen (it will reopen if I don’t have the launch mode tag.)

Another example. If I go from Activity A to Activity B to Activity A to Activity B everything is fine. When I click back i go to Activity A (as expected) however when I click back again I go to a previous instance of Activity A (uh oh) then I click back again and exit the app. Both times skipping Activity B.

I’m clearly overlooking something but I can’t figure out what. I’m not overriding any back button functionality and everything worked perfectly before I switched the start up activity.

Edit
The following is an excerpt from my manifest before any change

<activity android:name=".ActivityA" android:windowSoftInputMode="stateHidden" android:label="@string/app_name" android:launchMode="singleTask">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name="ActivityB"></activity>

Here is an excerpt after the change

<activity android:name=".ActivityB" android:windowSoftInputMode="stateHidden" android:label="@string/app_name" android:launchMode="singleTask">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name="ActivityA"></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-06-07T22:29:38+00:00Added an answer on June 7, 2026 at 10:29 pm

    Sounds like Activity B is getting finish() called or something. I suggest putting in some log statements in OnCreate, OnPause, OnResume, and OnDestroy so you can monitor the life of Activity B. Its a highlander activity (there can only be 1) so you don’t have to worry about multiple instances being created. Also you might look into / override onNewIntent and placing some logging calls there.

    Not really an answer, but dollars to donuts you or someone put a finish() call after starting Activity A, or when Activity B goes in the background and you’ve forgotten about it.

    If that’s not the case I’d be interested in how/when Activity B dies. Usually if it stops because of some error upon returning to it, Android will bark at you but since you didn’t mention that I’d guess it isn’t.

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

Sidebar

Related Questions

Most of Knockout seems very intuitive. One thing that is strange to me though
So here's a very strange thing I've seen FCKEditor do: If there's a large
Very strange thing happening here in IE7, IE8: index.php versus index-2.php As you can
Hi guys I have a very frustrating and strange thing happening here, when I
A very strange thing occured in my program. Here is the simplified code. class
I found a very interesting/strange thing about MAX() function in SQL. I have column
I have a very strange, very repeatable leak that doesn't appear to have anything
A very strange thing is happening. I am running a script on a new
This seems very strange to me but I have a script that I'm running
I have a strange mysql-thing going on here, it is about the following code:

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.