Mark, thanks for the quick reply.

Well, this may not be a problem on older APIs after all.  I was testing on 
4.x devices (Moto Xoom and Samsung GSIII) and touch events outside of the 
dialog (the Activity using Theme.Dialog) cause the dialog activity to be 
cancelled and the events do get passed back to the background activity. 
 Adding the "android:windowCloseOnTouchOutside" in the style definition 
prevents this in API 11 and higher devices.

However, it appears that in older devices (I've tested on emulators using 
2.2 and 2.3.3), the touch events do NOT get passed back by default, so 
there may not an issue for me here.  This default behavior may have changed 
in new versions of Android.

One exception I have seen is for the original Kindle Fire, running 2.3.4 (I 
have not tested on the newer Kindle devices).  It handles a touch outside 
the dialog as a "back" button press.  In the logcat I see this message: 
"Simulating 
back button on press outside dialog" followed by the call to 
onKeyDown(keyCode, KeyEvent), which is simple to override and ignore for 
keyCode 
== KeyEvent.KEYCODE_BACK.

So, I believe between these 3 different behaviors, I am able to prevent the 
issue in my original post.  Hopefully this is helpful to others along the 
way!

Regards,
Blake 


On Friday, December 14, 2012 3:05:39 PM UTC-6, Mark Murphy (a Commons Guy) 
wrote:
>
> On Fri, Dec 14, 2012 at 3:54 PM, Mark Murphy 
> <mmu...@commonsware.com<javascript:>> 
> wrote: 
> > On Fri, Dec 14, 2012 at 3:41 PM, Blake B. <bbuck...@yahoo.com<javascript:>> 
> wrote: 
> >> I have an Activity that is using the Theme.Dialog theme to present a 
> dialog 
> >> to the user.  By default however, when the user touches outside of the 
> >> dialog window, the touch event is passed to the views of the Activity 
> in the 
> >> background. 
> > 
> > AFAIK, it should not do that. Do you have a sample app that 
> > demonstrates this behavior? 
>
> I just tossed together a quick scrap app, with a regular Activity 
> launching a Theme.Dialog activity. Nothing special, and on a 2.2 
> emulator, touch events outside the dialog are not delivered to the 
> visible regular activity. Leastways, the buttons I try tapping on in 
> the non-foreground activity do not respond. 
>
> So, if you can reproduce your findings in something we can look at, 
> that would be very interesting. 
>
> -- 
> Mark Murphy (a Commons Guy) 
> http://commonsware.com | http://github.com/commonsguy 
> http://commonsware.com/blog | http://twitter.com/commonsguy 
>
> Aqui estão alguns sites onde você pode perguntar ou responder dúvidas 
> sobre desenvolvimento de aplicações para Android: 
> http://www.andglobe.com 
>

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to