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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:15:44+00:00 2026-06-13T06:15:44+00:00

I have two intent filters for the root activity of my application <activity android:name=.MyActivity

  • 0

I have two intent filters for the root activity of my application

<activity
    android:name=".MyActivity"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Dialog" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.nfc.action.NDEF_DISCOVERED" />
        <data android:mimeType="application/com.example.package" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>

One filter is for launching the application from the launcher icon, the other is to launch the activity when the user touches an NFC tag.

I want that when user presses the HOME button from any activity in the application, the next time he presses the launcher icon or touches NFC tag, the application must resume (as it is the case with every application).

But this is what is happening:
When user taps the NFC tag, the first activity is launched. Then he navigates onto further activities. Presses HOME. Taps the NFC tag again, the first activity (MyActivity) is launched, and the previous stack is cleared.

On the other hand,
When the user selects the launcher icon, navigates onto further activities, presses HOME, and then presses the the launcher icon again, MyActivity is started as a new activity on top of the stack. (now there are two MyActivities in the stack).

  • 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-13T06:15:45+00:00Added an answer on June 13, 2026 at 6:15 am

    You need to define the way your activity launches.
    If you want your activity to always launch on the same task use: android:alwaysRetainTaskState="true" and android:taskAffinity="your.task.name"

    Also take a look on android:launchMode="singleTop" and android:launchMode="singleTask" for further control on how the activity is launched.

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

Sidebar

Related Questions

I have the following inside my manifest file: <service android:name=.Rotate android:enabled=true android:label=@string/app_name> <intent-filter> <action
I have an application that contains two Activities with <intent-filter> <action android:name=android.intent.action.MAIN/> <category android:name=android.intent.category.LAUNCHER/>
I have a Cordova/PhoneGap 2.0 based Android application, and I'm attemping to use intent-filters
I am writing an Android app with two entry points that have intent filters
I have two relatively simple codes. One main activity and one intent service. Main
I have an Android Activity that needs to catch two different broadcasts. My current
I have an BroadcastReceiver for handling new or modified applications: <receiver android:name=.PackageHandler > <intent-filter>
I have two activities with exactly same intent filters and I would like to
i am new to android application.I have created two sample applications as Oneproject,Twoproject.when i
Have two actionsheet buttons and one modalviewcontroller on mainviewcontroller in application. Now for two

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.