Please show us the stack trace generated by the exception.

On Thu, Jan 5, 2012 at 11:46 AM, John Davis <davi...@gmail.com> wrote:
> Hello Mark,
>
> Nope.
>            for (int i=0;i<numRows;i++) {
>                // If it is the 2nd or 5th item, tag it so that it will be
> displayed in blue.
>                if (i==2 || i==5) {
>                        listCount = adapter.getCount();
>                        count = theList.getCount();
>                        fooView = (View) theList.getItemAtPosition(i);
> //                      fooView.setTag(99);
>                }
>
> i=2, listCount = 6 and count = 6.  The listview stored in theList is
> functional, since it retuns the result provided by getCount.  It is
> also in agreement with the array adapter count.
> theList.getItemAtPositon(5) should either return the item or null.  It
> raises and exception.  That is a bug.
>
> Once again, the docs say:
> =========================
> public Object getItemAtPosition (int position)
>
> Since: API Level 1
> Gets the data associated with the specified position in the list.
> Parameters
>
> position        Which data to get
> Returns
>
> The data associated with the specified position in the list
>
> ===============
>
> On Thu, Jan 5, 2012 at 2:31 PM, Mark Murphy <mmur...@commonsware.com> wrote:
>> 2012/1/5 John Davis <davi...@gmail.com>:
>>> The only exception which i can find is 
>>> javalang.unsupportedOperationException.
>>> as I was saying the api has a bug. The docs say you can get the data,
>>> when you try to so you get an exception. Either the docs are incorrect
>>> or its a bug.
>>
>> Yes, it is a bug in your code. My guess is that you are asking for an
>> invalid position, perhaps because numRows is greater than getCount().
>>
>> --
>> 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
>
>
>
> --
> John F. Davis
>
> 独树一帜
>
> --
> 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



-- 
Romain Guy
Android framework engineer
romain...@android.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

Reply via email to