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

  • Home
  • SEARCH
  • 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 6137073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:40:52+00:00 2026-05-23T17:40:52+00:00

In my application, I have specified a second activity that can be launched from

  • 0

In my application, I have specified a second activity that can be launched from the launcher, using this manifest entry:

    <activity 
        android:name=".Lists.ListOfListsActivity"
        android:icon="@drawable/ic_launcher_lists" 
        android:launchMode="singleTop"
        android:label="@string/lists_activity_name" >
        <!--  An Intent filter so that the Lists activity shows in the Launcher -->
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

Let’s say I have the app open at the “main” activity then press the home key. My app will still be running, but in background.

Later the user selects the launcher icon I have for “ListsOfListsActivity” from the homescreen.

This will bring the application to the foreground, but NOT at the “ListOfListsActivity”, but at whatever it’s current activity was when it went to the background (e.g. at the “main”activity).

This is confusing, as the user selected the “ListOfListsActivity” but is shown another one. Then they have to navigate to it.

I had this working better, by specifying launchMode = “singleTask” for the “ListOfListsActivity”, but in that mode it cannot be launched from another activity for a result (startActivityForResult() ), and I need to be able to do that to pick a list…

Question:
– how to specify an intent-filter that will force an activity to the foreground and be the selected activity, no matter what the current status of the application and it’s current 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-23T17:40:53+00:00Added an answer on May 23, 2026 at 5:40 pm

    My final implementation was to define a different taskAfinity string for each activity I wanted to launch independently from the Launcher.

    That way, each “shortcut” always launches the activity I want, but the downside that I have not been able to avoid is that the user may have multiple tasks with an activity from my application in it, and maybe the same activity open/active in different tasks….

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

Sidebar

Related Questions

I have an application that reads times from a file. These times can be
I'm developing an application on android 3.1 and I have an Activity A that
I have an application, which sets an alarm using AlarmManager, which starts another Activity
Here's the deal: I have an Android application that needs to call a web
I have a specific Silverlight application, that is fed with data by a WCF-Service.
I have a particular application that needs to calculate something very specific, and while
I have created an application that uses settings.settings to store some user specific settings
I have an internal web application, that is IE specific, and uses a lot
I have an application that needs to connect to a SQL database, and execute
Hi i am using tcpdf in my application and i have two question about

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.