Received: by 10.182.121.70 with SMTP id li6mr170810obb.48.1350060812251; Fri, 12 Oct 2012 09:53:32 -0700 (PDT) X-BeenThere: android-developers@googlegroups.com Received: by 10.182.225.35 with SMTP id rh3ls3215736obc.0.gmail; Fri, 12 Oct 2012 09:51:34 -0700 (PDT) Received: by 10.66.76.38 with SMTP id h6mr1158774paw.15.1350060694914; Fri, 12 Oct 2012 09:51:34 -0700 (PDT) Received: by 10.66.76.38 with SMTP id h6mr1158773paw.15.1350060694903; Fri, 12 Oct 2012 09:51:34 -0700 (PDT) Return-Path: Received: from mail-pb0-f47.google.com (mail-pb0-f47.google.com [209.85.160.47]) by gmr-mx.google.com with ESMTPS id m8si2098359pav.2.2012.10.12.09.51.34 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Oct 2012 09:51:34 -0700 (PDT) Received-SPF: pass (google.com: domain of magouyaw...@gmail.com designates 209.85.160.47 as permitted sender) client-ip=209.85.160.47; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of magouyaw...@gmail.com designates 209.85.160.47 as permitted sender) smtp.mail=magouyaw...@gmail.com; dkim=pass header...@gmail.com Received: by mail-pb0-f47.google.com with SMTP id ro12so3104551pbb.20 for ; Fri, 12 Oct 2012 09:51:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=tvA53GUX4Syxekeu3t69kqhVW8fQXb5nFafwg/ZjOTU=; b=R7JVQRUv+k5obSeipaVDCVzbXL2ATV28/DGEBw/s9A1Osa6bY9SBvmIV2psQ6oAmMd odE79BBAVakrGOPT5gFv7mITv34CUnfoZAmkWnImvZMMJoT1iwdqJPMETsg2Vv/uagcY 0WYWYZjUTWCrEkNRyqK2ha7Anrq71r65lIG0EQILKTd58s6AQ79/rnTNqeTKXGZQyVaU WMK2H7rY6KYALuxeZHxCMIgIk3HPo50Evx0ZkGP+FBxIsjUcpCS6V35lBLE1cNeTrES5 NyC2ZON31Pp5zSWRcNDR4lNsNzKstEm6hNrCfnRT4ydDlcm86vvhOcSs2/ZnDdJd3aqD mZyA== Received: by 10.68.224.132 with SMTP id rc4mr14997005pbc.155.1350060694689; Fri, 12 Oct 2012 09:51:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.66.193.225 with HTTP; Fri, 12 Oct 2012 09:51:14 -0700 (PDT) In-Reply-To: <8fe66270-3c99-4ebc-b667-f4578568f72b@googlegroups.com> References: <8fe66270-3c99-4ebc-b667-f4578568f72b@googlegroups.com> From: Justin Anderson Date: Fri, 12 Oct 2012 10:51:14 -0600 Message-ID: Subject: Re: [android-developers] Custom notification with a button: the notification bar stays open when clicking on it (on 4.0) To: android-developers@googlegroups.com Content-Type: multipart/alternative; boundary=e89a8ff244b521d71304cbdf80d2 --e89a8ff244b521d71304cbdf80d2 Content-Type: text/plain; charset=ISO-8859-1 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 On Fri, Oct 12, 2012 at 8:14 AM, BoD wrote: > 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 received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscribe@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en --e89a8ff244b521d71304cbdf80d2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Have you tested this on a real 4.0 device?=A0 It might just be an emulator = bug...

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


On Fri, Oct 12, 2012 at 8:14 AM, BoD <= bodlu...@gmail.com> wrote:
Hi!

I am working on an app that shows a notification tha= t uses a custom layout (notification.contentView =3D remoteViews), that con= tains a button.
First of all, I am aware that there are new A= PIs 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:
=A0 =A0= =A0 =A0 Intent clickIntent =3D new Intent(this, MyActivity.class);
=A0 =A0 =A0 =A0 clickIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_T= ASK);
=A0 =A0 =A0 =A0 contentView.setOnClickPendingIntent(R.id.button, Pendi= ngIntent.getActivity(this, 0, clickIntent, PendingIntent.FLAG_CANCEL_CURREN= T));

This works as intended, but my prob= lem 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 (t= he behavior I want!)
- On a 4.0 emulator, when clicking on the bu= tton, the notification bar stays open, thus the=A0newly 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,

--=A0<= /div>
BoD

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com<= br> To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=3Den<= /font>

--e89a8ff244b521d71304cbdf80d2--