davebren / Goot

16 stars 7 forks source link

ArrayIndexOutOfBoundsException #44

Open davebren opened 10 years ago

davebren commented 10 years ago

java.lang.ArrayIndexOutOfBoundsException: length=0; index=0 at com.project.gutenberg.book.view.BookFormatting.initializeFormatting(BookFormatting.java:27) at com.project.gutenberg.book.view.BookFormatting.(BookFormatting.java:15) at com.project.gutenberg.book.view.BookView.(BookView.java:23) at com.project.gutenberg.book.view.android.AndroidBookView.(AndroidBookView.java:30) at com.project.gutenberg.Home.openBook(Home.java:171) at com.project.gutenberg.Home.refreshBook(Home.java:217) at com.project.gutenberg.Home.access$200(Home.java:28) at com.project.gutenberg.Home$2.onResponse(Home.java:125) at com.project.gutenberg.Home$2.onResponse(Home.java:123) at com.project.gutenberg.Home.onCreateOptionsMenu(Home.java:88) at android.app.Activity.onCreatePanelMenu(Activity.java:2561) at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:446) at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:820) at com.android.internal.policy.impl.PhoneWindow$1.run(PhoneWindow.java:3163) at android.os.Handler.handleCallback(Handler.java:615) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4950) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771) at dalvik.system.NativeStart.main(Native Method)

AliceCengal commented 10 years ago

Could you be more specific as to how this error happens? It seems that the value of linesPerPage calculated in line 25 of BookFormatting.java is zero, meaning that the text is too large to fit in one screen? Or is the screen too small? Was it in landscape conf?

davebren commented 10 years ago

This a crash report from a user, I'll have to look into it to see what the exact issue is, but yeah it might be a combination of those reasons. There may need to be a limit set to text size based on screen height.