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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:25:45+00:00 2026-06-08T11:25:45+00:00

Intent intent = new Intent(_context, MainActivity.class); PendingIntent activity = PendingIntent.getActivity(_context, 0, intent, 0); notification.contentIntent

  • 0
    Intent intent = new Intent(_context, MainActivity.class);
    PendingIntent activity = PendingIntent.getActivity(_context, 0, intent, 0);
    notification.contentIntent = activity;

Enter MainActivity from notification if MainActivity is already opened, thus I need exit twice. Is this a falg problem, what should I do?

  • 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-08T11:25:47+00:00Added an answer on June 8, 2026 at 11:25 am

    Yes It is.. You have to add this flag to your pending Intent.

    Intent intent = new Intent(_context, MainActivity.class);
    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP|   Intent.FLAG_ACTIVITY_NEW_TASK);
    PendingIntent activity = PendingIntent.getActivity(_context, 0, intent, 0);
    

    Taken form here,

    https://stackoverflow.com/a/7308940/603744

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

Sidebar

Related Questions

private void setFPAlarm() { Intent intent = new Intent(this, FPService.class); PendingIntent pi = PendingIntent.getService(this,
Typically you start a service like this Intent i = new Intent(context,MessageService.class); context.startService(i); but
Code like this works well. Intent configIntent = new Intent (context, WidgetConfigActivity.class); configIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
Trying to implement google C2DM service. registrationIntent.putExtra(app, PendingIntent.getBroadcast(context,0,new Intent(), 0)); registrationIntent.putExtra(sender,example@gmail.com); context.startService(registrationIntent); Almost every
For example Intent intent = new Intent(this, SecondActivity.class); eclipse error: The method setClass(Context, Class)
import android.content.Intent; import android.net.*; public class ignitionClass { Intent dialI = new Intent(Intent.ACTION_CALL, Uri.parse(tel:610-970-1218));
I have the following code: Intent serviceIntent = new Intent(this, ServiceClass.class); startService(serviceIntent); I have
This is my code: public class MainActivity extends Activity { private ComponentName mService; private
I use addProximityAlert: Intent intent = new Intent(getString(R.string.intent_message_location_fetched)); PendingIntent proximityIntent = PendingIntent.getBroadcast(this, 0, intent,
I'm looking for the best way to start an intent from a class that

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.