Re: [android-developers] List view problem

2011-04-27 Thread Kostya Vasilyev
What works for me is something like this: res/layout/item_layout.xml etc. Now in getItem(), I change the background of R.id.item_root, not of R.id.item_top (which is left intact). -- Kostya 27.04.2011 22:59, Kumar Bibek пишет: I am a little confused here. I inflate a layout, which h

Re: [android-developers] List view problem

2011-04-27 Thread Kumar Bibek
I am a little confused here. I inflate a layout, which has a single TextView inside a LinearLayout. In the adapter, I use the convertView to recycle views, so, now I don't try to change the convertView's backgound, rather, I am now changing the LinearLayout's background. I also tried to change th

Re: [android-developers] List view problem

2011-04-27 Thread Kostya Vasilyev
27.04.2011 22:44, Kumar Bibek пишет: Hmm, I tried injecting a view group at the root of the items, but still it doesn't work. Weird. Did you adjust the code to change the background of this newly injected view group? And leave the root view group alone? When I put logs, correct view types ge

Re: [android-developers] List view problem

2011-04-27 Thread Kumar Bibek
Hmm, I tried injecting a view group at the root of the items, but still it doesn't work. Weird. When I put logs, correct view types get returned, and morever, the gravity stuff works fine, but the backgrounds just dont work. Damn!! I thought I knew list views very well. Kumar Bibek http://techdro

Re: [android-developers] List view problem

2011-04-27 Thread Kostya Vasilyev
27.04.2011 22:33, Mark Murphy пишет: On Wed, Apr 27, 2011 at 2:29 PM, Kostya Vasilyev wrote: It probably means it won't be called by itself. Precisely. Sometime after you call setAdapter(), then (and only then) will getViewTypeCount() be called. Right. I'm not quite sure why they are empha

Re: [android-developers] List view problem

2011-04-27 Thread Mark Murphy
On Wed, Apr 27, 2011 at 2:29 PM, Kostya Vasilyev wrote: > It probably means it won't be called by itself. Precisely. Sometime after you call setAdapter(), then (and only then) will getViewTypeCount() be called. I'm not quite sure why they are emphasizing the point. -- Mark Murphy (a Commons Gu

Re: [android-developers] List view problem

2011-04-27 Thread Kostya Vasilyev
It probably means it won't be called by itself. Re: background. A ListView changes its item's backgrounds at runtime to show selection state, so you should not be changing the background of the root view of your items. As a workaround, inject another view group inside the item's top level la

Re: [android-developers] List view problem

2011-04-27 Thread Kumar Bibek
Thanks Mark. I don't really understand what it means. I have a list view, and I attach the adapter through the setAdapter method of the ListView. Should I be doing something else? Kumar Bibek http://techdroid.kbeanie.com http://www.kbeanie.com On Wed, Apr 27, 2011 at 11:53 PM, Mark Murphy wrot

Re: [android-developers] List view problem

2011-04-27 Thread Mark Murphy
On Wed, Apr 27, 2011 at 2:17 PM, Kumar Bibek wrote: > getItemViewType(int position) - Overridden > getViewTypeCount() - Overridden (Always returns 3) > > I was going through the docs, and I found this. > > public int getViewTypeCount () > > Returns the number of types of Views that will be created

[android-developers] List view problem

2011-04-27 Thread Kumar Bibek
I have a list view which display multiple kinds of items (Basically 3). I have overridden all the methods, and it works almost fine. Basically, For those three types of views, I need to change the gravity to either left/right or center (Simple TextViews). This works. In addition to this, I also

[android-developers] List view problem

2009-11-10 Thread c.a.jeffer...@googlemail.com
Hi, I am using a list view and and the onListItemClick() method. The problem I am having is that when I press the back button and tap on another item on the list the position value stays the same. Has anyone else encountered this problem? thanks, Clive -- You received this message because y