Re: [android-developers] onContextMenuClosed() not called under 2.x?

2010-01-04 Thread Jonas Petersson
Hi again,

For the record of anyone else running into this, I've found a somewhat 
useful workaround:

Just before calling "openContextMenu()" I now call "closeContextMenu()" 
- this seems to restore sanity. When things work as expected it has no 
effect at all (as expected), but when the user has pressed Back on a 2.0 
device (read "Milestone") previously this will ensure 
onContextMenuClosed() is called - later than expected, but better than 
nothing and at least the state is sane before the new menu occurs.

Further advice appreciated. Maybe my case is somewhat on the edge since 
the View in question is a single fullscreen one (the map), but even so 
there should be symmetry IMHO - if onContextItemSelected() works, then 
so should onContextMenuClosed(), right?

Best / Jonas

Jonas Petersson wrote:
> Dear Experts,
> 
> In one of my applications I programmatically open the context menu
> when something is clicked in my MapActivity overlay. This works
> perfectly under 1.x as well as on my 2.0 Milestone.  I've used
> showContextMenuForChild() historically, but openContextMenu() does
> that same thing.
> 
> As expected onCreateContextMenu() is called to build the menu and then
> onContextItemSelected() is called when something is selected. So far
> all is well.
> 
> The odd thing is that under 1.x the onContextMenuClosed() method is
> called when I press the back key, but not so under 2.0. This confuses
> states for my app since I need to know whether menu is shown or not - or 
> maybe there is a way to know this that I have not (yet) figured out...
> 
> Is this a deliberate change or should I file it as a bug? Googling
> comes up pretty dry (stuff that is over a year old).
> 
> Anyone with a 2.0.1 Droid that would care to test whether this has
> already been fixed? (The ETA for Milestone 2.0.1 seems hazy still, but
> it appears that at least one of my reported bugs has been fixed in 2.0.1 
> event though it isn't flagged as such.)
> 
>  Many thanks in advance / Jonas
> 

-- 
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


[android-developers] onContextMenuClosed() not called under 2.x?

2010-01-01 Thread Jonas Petersson
Dear Experts,

In one of my applications I programmatically open the context menu
when something is clicked in my MapActivity overlay. This works
perfectly under 1.x as well as on my 2.0 Milestone.  I've used
showContextMenuForChild() historically, but openContextMenu() does
that same thing.

As expected onCreateContextMenu() is called to build the menu and then
onContextItemSelected() is called when something is selected. So far
all is well.

The odd thing is that under 1.x the onContextMenuClosed() method is
called when I press the back key, but not so under 2.0. This confuses
states for my app since I need to know whether menu is shown or not - or 
maybe there is a way to know this that I have not (yet) figured out...

Is this a deliberate change or should I file it as a bug? Googling
comes up pretty dry (stuff that is over a year old).

Anyone with a 2.0.1 Droid that would care to test whether this has
already been fixed? (The ETA for Milestone 2.0.1 seems hazy still, but
it appears that at least one of my reported bugs has been fixed in 2.0.1 
event though it isn't flagged as such.)

 Many thanks in advance / Jonas

-- 
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