ardiany / and-bookworm

Automatically exported from code.google.com/p/and-bookworm
0 stars 0 forks source link

BookSearch index out of bounds except #65

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Search for something that returns results, like "test" then with results on 
page create a new search for nonsense "loiutrrwywy" which returns no 
results. However, prev results are still shown, clicking on any of them 
results in IOBE. 

java.lang.IndexOutOfBoundsException: Invalid location 10, size is 10
  at java.util.ArrayList.get(ArrayList.java:341)
  at com.totsp.bookworm.BookSearch$2.onItemClick(BookSearch.java:83)
  at android.widget.AdapterView.performItemClick(AdapterView.java:284)
  at android.widget.ListView.performItemClick(ListView.java:3285)
  at android.widget.AbsListView.onKeyUp(AbsListView.java:1757)
  at android.widget.ListView.commonKey(ListView.java:2059)
  at android.widget.ListView.onKeyUp(ListView.java:1968)
  at android.view.KeyEvent.dispatch(KeyEvent.java:1061)
  at android.view.View.dispatchKeyEvent(View.java:3683)
  at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
  at android.widget.ListView.dispatchKeyEvent(ListView.java:1943)
  at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:748)
  at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:748)
  at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:748)
  at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:748)
  at 
com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEven
t(PhoneWindow.java:1655)
  at 
com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWin
dow.java:1102)
  at android.app.Activity.dispatchKeyEvent(Activity.java:2038)
  at 
com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(Pho
neWindow.java:1631)
  at 
android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:2368)
  at android.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2338)
  at android.view.ViewRoot.handleMessage(ViewRoot.java:1641)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:123)
  at android.app.ActivityThread.main(ActivityThread.java:4363)
  at java.lang.reflect.Method.invokeNative(Method.java:-2)
  at java.lang.reflect.Method.invoke(Method.java:521)
  at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:
860)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
  at dalvik.system.NativeStart.main(NativeStart.java:-2)

Original issue reported on code.google.com by charlie....@gmail.com on 1 Jun 2010 at 12:46

GoogleCodeExporter commented 9 years ago
Fixed by clearing out the list if there are no results. This might come back up 
though 
if pressing the "more results" button eventually ends up with no results (would 
clear 
all the prev results). I can't get that to happen yet, even with very specific 
terms 
(either never ending results, or zero at start). 

Original comment by charlie....@gmail.com on 1 Jun 2010 at 1:01