Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Custom notification with a button: the notification bar stays open when clicking on it (on 4.0)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
BoD  
View profile  
 More options Oct 12 2012, 10:14 am
From: BoD <bodlu...@gmail.com>
Date: Fri, 12 Oct 2012 07:14:17 -0700 (PDT)
Local: Fri, Oct 12 2012 10:14 am
Subject: Custom notification with a button: the notification bar stays open when clicking on it (on 4.0)

Hi!

I am working on an app that shows a notification that uses a custom layout
(notification.contentView = remoteViews), that contains a button.
First of all, I am aware that there are new APIs to do this in 4.1 but my
app has to work on 4.0.
I want the button to start an activity so I do this:
        Intent clickIntent = new Intent(this, MyActivity.class);
        clickIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        contentView.setOnClickPendingIntent(R.id.button,
PendingIntent.getActivity(this, 0, clickIntent,
PendingIntent.FLAG_CANCEL_CURRENT));

This works as intended, but my problem is:
- On a 4.1 Galaxy Nexus, when clicking on the button, the notification bar
collapses, thus the newly displayed activity is visible to the user (the
behavior I want!)
- On a 4.0 emulator, when clicking on the button, the notification bar
stays open, thus the newly displayed activity is not visible to the user

Does anybody know if there is a way to control this, so the bar will also
close on 4.0?

Thanks a lot,

--
BoD


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Justin Anderson  
View profile  
 More options Oct 12 2012, 12:53 pm
From: Justin Anderson <magouyaw...@gmail.com>
Date: Fri, 12 Oct 2012 10:51:14 -0600
Local: Fri, Oct 12 2012 12:51 pm
Subject: Re: [android-developers] Custom notification with a button: the notification bar stays open when clicking on it (on 4.0)

Have you tested this on a real 4.0 device?  It might just be an emulator
bug...

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
BoD  
View profile  
 More options Oct 13 2012, 5:32 pm
From: BoD <bodlu...@gmail.com>
Date: Sat, 13 Oct 2012 14:32:36 -0700 (PDT)
Local: Sat, Oct 13 2012 5:32 pm
Subject: Re: [android-developers] Custom notification with a button: the notification bar stays open when clicking on it (on 4.0)

Yes I have tested this on an HTC One S running Android 4.0: the
notification bar stays open.

--
BoD


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
BoD  
View profile  
 More options Oct 15 2012, 2:32 pm
From: BoD <bodlu...@gmail.com>
Date: Mon, 15 Oct 2012 11:32:45 -0700 (PDT)
Local: Mon, Oct 15 2012 2:32 pm
Subject: Re: Custom notification with a button: the notification bar stays open when clicking on it (on 4.0)

If somebody from the Android team could chime in, I would greatly
appreciate it! :)

Thanks for your help!

--
BoD


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »