Re: [android-developers] IndexOutofBoundsException thrown from getViewAt() in RemoteViewFactory

2012-06-16 Thread Harri Smått
Ah, my bad. Thought it was your code causing IndexOutOfBoundsException. -- H On Jun 14, 2012 4:12 PM, Ethan Gao ethangao.stu...@gmail.com wrote: I didn't ask for getViewAt(index=1), this method is called by android framework(I think it's called by RemoteViewsAdater). I can not figure out the

[android-developers] IndexOutofBoundsException thrown from getViewAt() in RemoteViewFactory

2012-06-14 Thread Ethan Gao
I am attempting to create a widget for android 4.0 phone. But the widget might crash after user clicks the clear data button in application's setting view. I looked into logcat, it saysIndexOutofBoundsException in getViewat() method. This is super weird in my eyes, since I put log in both

Re: [android-developers] IndexOutofBoundsException thrown from getViewAt() in RemoteViewFactory

2012-06-14 Thread Harri Smått
On Jun 14, 2012, at 1:37 PM, Ethan Gao wrote: Firstly, getCount() methods return 1, but the consequence getViewat() is still trying to get view at position 1 and 2. If getCount() returns 1, you shouldn't ask for getViewAt(index) where index = 1. It's your responsibility to make sure you do

Re: [android-developers] IndexOutofBoundsException thrown from getViewAt() in RemoteViewFactory

2012-06-14 Thread Ethan Gao
I didn't ask for getViewAt(index=1), this method is called by android framework(I think it's called by RemoteViewsAdater). I can not figure out the reason RemoteViewsAdatper is calling getViewAt(index=1) after it called getCount() which returns 1. I suspect that this is an android bug, since