On Sat, Jul 16, 2011 at 9:48 AM, Jim Graham <spooky1...@gmail.com> wrote: >> Step #1: Confirm that 42 is in the range from >> getFirstVisiblePosition() to getLastVisiblePosition(). Do >> something if it's not. > > Interesting. A search on that in the dev guide leads me to > ListView, where, unless I missed it again and again, it isn't > even mentioned. :-) So let me see if I have this right, without > referring to the dev guide (which usually seems to produce much > better search results for me these days)....
Those methods are on AdapterView, an ancestor class. Click on [Expand] on "Inherited Methods" in ListView to see them on the ListView page. > I have a ListView; let's call it myList. I would use something > like: > > topidx = myList.getFirstVisiblePosition() > > to find out what the position/row number is on top of the screen. > > If it's the one I want, I'm done. If not, move the one I want up > by the difference, and double-check, adjusting again if I missed > by one. > > Have I got that right? If so, that's exactly what I need to > solve all of this. If not, what did I miss? Sounds plausible. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- 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