Nope... you've got it backwards. It would be: getListView().getChildAt(50 - getListView().getFirstVisiblePosition()))
Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Fri, Mar 9, 2012 at 1:03 PM, RedBullet <[email protected]> wrote: > Really? > > So, if I have 100 items in my ListView, and I want to be monkeying around > with item #50 I would do: > getListView().getChild(getListView().getFirstVisiblePosition() - 50)) ? > > that doesn't seem right... > > > On Friday, March 9, 2012 2:42:29 PM UTC-5, MagouyaWare wrote: > >> Didn't mean to send that yet... >> >> You can calculate the correct index by using this: >> http://developer.android.com/**reference/android/widget/** >> AdapterView.html#**getFirstVisiblePosition%28%29<http://developer.android.com/reference/android/widget/AdapterView.html#getFirstVisiblePosition%28%29> >> >> You subtract the position in the adapter from the first visible position. >> >> Thanks, >> Justin Anderson >> MagouyaWare Developer >> http://sites.google.com/site/**magouyaware<http://sites.google.com/site/magouyaware> >> >> >> On Fri, Mar 9, 2012 at 12:41 PM, Justin Anderson <> wrote: >> >>> Try using this: >>> http://developer.android.com/**reference/android/view/** >>> ViewGroup.html#getChildAt%**28int%29<http://developer.android.com/reference/android/view/ViewGroup.html#getChildAt%28int%29> >>> >>> However, beware that the child index is not necessarily the same as the >>> position of the item in the ArrayAdapter due to view recycling. But you >>> can get the correct index >>> >>> Thanks, >>> Justin Anderson >>> MagouyaWare Developer >>> http://sites.google.com/site/**magouyaware<http://sites.google.com/site/magouyaware> >>> >>> >>> >>> On Fri, Mar 9, 2012 at 12:32 PM, RedBullet <> wrote: >>> >>>> So, I have a class that implements ListActivity, and it loads up a a >>>> list of turns for turn-by-turn navigation. >>>> >>>> Essentially I want to decorate the item that is the next waypoint in >>>> the list, and when you arrive, de-decorate and decorate the next waypoint >>>> in the list. >>>> >>>> So, I have been noodling this, but haven't figured out how to do this >>>> yet. >>>> >>>> I know I can call setSelected(int) to say which item is the current >>>> one, but I don't see how I can get the view associated with the currently >>>> selected item. >>>> >>>> I don't think getView is right since I am not populating the ListView. >>>> >>>> Any ideas? >>>> >>>> -- >>>> >>>> >>> >> -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

