[android-developers] Re: How to keep focus highlight on ExpandableList group....
I'm struggling with a similar issue myself at the moment. I traced mine down to the fact that modifying the child component caused it to call RequestLayout(). This in turn, caused the parent to relayout which unfortunately meant removing and replacing the component with a new one - thus the focus being lost. I fixed this specific problem by overriding the adapter so that it always used the same instance of the child view when editing. (I'm not sure why the internal recycling didn't seem to be doing this already though...) This might be enough for your situation, however, I'm still left with the component receiving the focus but not displaying as focused. That's the subject of my other thread. Just a few thoughts... Peter. -Original Message- From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of John B. Hansen Sent: Thursday, 16 April 2009 6:27 AM To: Android Developers Subject: [android-developers] How to keep focus highlight on ExpandableList group I'm using an ExpandableListActivity and notice that whenever I select a group item (to expand or collapse it), it highlights briefly and then quickly un-highlights. For my application, I want the group items to remain highlighted. I've tried requestFocus() and several other things but nothing is working. Anyone know how to keep a selected group item (after expand or collapse) highlighted and focused? Any help appreciated. jh --~--~-~--~~~---~--~~ 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] Re: How to keep focus highlight on ExpandableList group....
This sounds odd. When you say select a group item do you mean expanding it using the dpad or touch? When the list goes into touch mode there isn't a notion of visible selection. j On Wed, Apr 15, 2009 at 11:02 PM, Peter Carpenter peter.carpen...@skytechnologies.com wrote: I'm struggling with a similar issue myself at the moment. I traced mine down to the fact that modifying the child component caused it to call RequestLayout(). This in turn, caused the parent to relayout which unfortunately meant removing and replacing the component with a new one - thus the focus being lost. I fixed this specific problem by overriding the adapter so that it always used the same instance of the child view when editing. (I'm not sure why the internal recycling didn't seem to be doing this already though...) This might be enough for your situation, however, I'm still left with the component receiving the focus but not displaying as focused. That's the subject of my other thread. Just a few thoughts... Peter. -Original Message- From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of John B. Hansen Sent: Thursday, 16 April 2009 6:27 AM To: Android Developers Subject: [android-developers] How to keep focus highlight on ExpandableList group I'm using an ExpandableListActivity and notice that whenever I select a group item (to expand or collapse it), it highlights briefly and then quickly un-highlights. For my application, I want the group items to remain highlighted. I've tried requestFocus() and several other things but nothing is working. Anyone know how to keep a selected group item (after expand or collapse) highlighted and focused? Any help appreciated. jh -- Jeff Sharkey jshar...@google.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 -~--~~~~--~~--~--~---
[android-developers] Re: How to keep focus highlight on ExpandableList group....
I found a partial answer to this. In general, you can use the following to select and highlight a group item: ExpandableListView.setSelectedGroup(groupPosition); But, it doesn't work in the OnGroup callback for setOnGroupClickListener (which is really where I need it to work). Will keep reviewing this. jh On Wed, Apr 15, 2009 at 1:26 PM, John B. Hansen jnahan...@gmail.com wrote: I'm using an ExpandableListActivity and notice that whenever I select a group item (to expand or collapse it), it highlights briefly and then quickly un-highlights. For my application, I want the group items to remain highlighted. I've tried requestFocus() and several other things but nothing is working. Anyone know how to keep a selected group item (after expand or collapse) highlighted and focused? Any help appreciated. jh --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---