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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:07:21+00:00 2026-05-28T14:07:21+00:00

I successfully created a custom rich notification for Android >= 3.0 that shows some

  • 0

I successfully created a custom rich notification for Android >= 3.0 that shows some text and an additional button. If you click the notification anywhere but on the button in the notification drop-down, the notification is dismissed, the drop-down closed and the specified Intent is launched as expected.
If the dedicated button in the notification is clicked, a different Intent is successfully launched, but the drop-down keeps open (and the notification is still there, but I cancel it later, that is not the problem). The Intent launches an Activity which appears behind the notifications drop-down.

What I like to achieve is to keep all the current behavior as described, but also close the notification drop-down from the Intent the button launches – is this possible? Alternatively it would be enough if the Activity from the button Intent gains the window focus.

Here the code for the custom notification, if that helps:

            Notification.Builder builder = new Notification.Builder(main)
                .setSmallIcon(R.drawable.notification)
                .setAutoCancel(true)
                .setTicker(text)
                .setContentIntent(...);

            RemoteViews layout = new RemoteViews(
                    main.getPackageName(), R.layout.notification);
            layout.setTextViewText(R.id.title, title);
            layout.setTextViewText(R.id.text, text);
            Intent i = new Intent(
                    "snooze", null, main, Snooze.class
            );
            i.putExtra(KEY_WIDGET_ID, widgetId);
            layout.setOnClickPendingIntent(R.id.notification_zzz, PendingIntent.getActivity( main, 0, i, PendingIntent.FLAG_UPDATE_CURRENT ));
            builder.setContent(layout);

            ...
            NotificationManager nm = 
                (NotificationManager)main.getSystemService(Context.NOTIFICATION_SERVICE);
            nm.notify(0, builder.getNotification());
  • 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-28T14:07:22+00:00Added an answer on May 28, 2026 at 2:07 pm

    Asked the question in the Android developer office hours:
    http://www.youtube.com/watch?v=XvLBvdml_Fs (question starting 49:10)

    The answer was, that it is not possible and I should not even do this, which I question.
    That is why I have created a feature request:
    http://code.google.com/p/android/issues/detail?id=24762

    EDIT 08-10-12:
    Starting with Android 4.1 this is possible as notifications can now include additional actions. See the following page for more information:
    https://developer.android.com/about/versions/android-4.1.html#UI

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

Sidebar

Related Questions

Good morning, I've successfully created a little app that registers itself under a custom
I have created a custom SharePoint web service that was deployed to, and successfully
I have successfully created an app that reads from a bundled .plist file and
I succesfully created a project using seam credentials for authentication, but right now some
I am currently learning to create custom controls in WPF. I successfully created a
I've created a custom Weblogic Security Authentication Provider on version 10.3 that includes a
I have created custom workflow and successfully deployed it on Alfresco. I just copied
I created WCF service that returns a custom object called XmlElementTreeNode. This is what
Noob Question here. I have created and successfully added an additional Page Layout to
Im using android sdk with eclipse in fedora. I successfully installed everything, created an

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.