Sunday, July 10, 2011

[android-developers] Re: ListView with CheckBox

Sorry, I forgot to say how you call this implementation..


listView.setOnItemClickListener(new OnItemClickListener(){

@Override
public void onItemClick(AdapterView<?> parent, View viewItem, int
position, long arg3) throws NullPointerException{


new UI(parent.getChildAt(position -
listView.getFirstVisiblePosition())).execute(parent);

}});

position is the position of the item clicked
listView.getFirstVisiblePosition() is the first fully visible position
in the list, in example if you have 0 position partially visible on
the screen the first visible position is 1....

So if you want to access the 3 position assuming that first visible
position is 1 = 3 - 1 = 2, which indeed is the 2... regardless
position==3 :)

All the best...

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

No comments:

Post a Comment