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

The Archive Base Latest Questions

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

I have a WidgetResultActivity and a NotificationResultActivity, I set both their launchmode=singleInstance. But they

  • 0

I have a WidgetResultActivity and a NotificationResultActivity, I set both their launchmode=singleInstance. But they have different behaviors: WidgetResultActivity will not opened from RECENT, while NotificationResultActivity will always be opened from RECENT(It is opened alone! Without MainActivity). So How can I forbid NotificationResultActivity opening from REcent, thx.

    <activity
        android:name=".WidgetResultActivity"
        android:launchMode="singleInstance"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" />

    <activity
        android:name=".NotificationResultActivity"
        android:launchMode="singleInstance"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" />

EDIT: Just See my ATester App, when I opened from notification…

Test code:

    NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
    Notification notification = new Notification(R.drawable.ic_launcher, getString(R.string.app_name), java.lang.System.currentTimeMillis());
    notification.flags = Notification.FLAG_NO_CLEAR;
    Intent intent = new Intent(this, ExcludeFromRecentActivity.class);
    // intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    PendingIntent activity = PendingIntent.getActivity(this, R.string.app_name, intent, PendingIntent.FLAG_UPDATE_CURRENT);
    notification.setLatestEventInfo(this, "Open Activity: " + ABox.class.getSimpleName(), "new Intent()", activity);
    manager.notify(R.string.app_name, notification);

Test manifest:

    <activity
        android:name=".ATester1"
        android:label="@string/app_name" >
    </activity>
    <activity
        android:name=".ATester2"
        android:label="@string/app_name" >
    </activity>
    <activity
        android:name=".ATester3"
        android:label="@string/app_name" >
    </activity>
    <activity
        android:name=".ExcludeFromRecentActivity"
        android:excludeFromRecents="true"
        android:label="@string/app_name" >
    </activity>

Test Images:

1st:enter image description here

2nd:enter image description here

3rd:enter image description here

4th:enter image description here

EDIT: What I really need is DIALOG BEHEVIOR LIKE ACTIVITY, I will ask in another post. @WebnetMobile.com, thank you all the same.

  • 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-13T07:15:33+00:00Added an answer on June 13, 2026 at 7:15 am
    android:taskAffinity="" 
    android:excludeFromRecents="true" 
    android:launchMode="singleInstance"
    

    taskAffinity is needed, this works for me.

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

Sidebar

Related Questions

Have 2 tables in Access 2007, both lists of certain tasks to be accomplished.
have been using no DOCTYPE but rather simply starting with <html> as per HTML5
Have two tables say ABC and XYZ and contain one column which data will
Have data that has this kind of structure. Will be in ascending order by
Have searched for the answer but no joy, so here goes... I'm working on
Have converted devise new session from erb to Haml but doens't work, this is
Have searched the database but need to specifically sum(of hours flown or days off)in
Have a numeric nvarchar values with some extra-symbols For example 1/2, 9/6, 14A They
Have a recurring situation, petty I know, but I'd like to consolidate the following:
Have their been any studies related to the importance of how good a software

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.