Closed ml1ght closed 11 years ago
And another one problem I have in android 2.3 - application don't works and crashes on start.
What's the log saying?
This is shown in log: FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ushahidi.android.app/com.ushahidi.android.app.ui.phone.ViewReportActivity}: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125) at android.app.ActivityThread.access$600(ActivityThread.java:140) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4898) 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:1006) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251) at java.util.ArrayList.get(ArrayList.java:304) at com.ushahidi.android.app.ui.phone.ViewReportActivity.initReport(ViewReportActivity.java:181) at com.ushahidi.android.app.ui.phone.ViewReportActivity.onCreate(ViewReportActivity.java:97) at android.app.Activity.performCreate(Activity.java:5206) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
@ml1ght Fixed. Try the latest code in develop
branch. Let me know how it goes.
Hi, error still stay in latest code in developer branch. FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ushahidi.android.app/com.ushahidi.android.app.ui.phone.ViewReportActivity}: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125) at android.app.ActivityThread.access$600(ActivityThread.java:140) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4898) 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:1006) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251) at java.util.ArrayList.get(ArrayList.java:304) at com.ushahidi.android.app.ui.phone.ViewReportActivity.initReport(ViewReportActivity.java:181) at com.ushahidi.android.app.ui.phone.ViewReportActivity.onCreate(ViewReportActivity.java:97) at android.app.Activity.performCreate(Activity.java:5206) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064) ... 11 more 04-23 09:59:26.315: E/Google Maps Android API(20396): Failed to load map. Could not contact Google servers.
I try to explain how get this error: When I chose test map in ListMapActivity -> go to the ReportTabActivity and chose category (where no reports) -> and then tap update button and chose someone report -> crash application.
@ml1ght are you running the latest develop
code? Update your repo and give it a spin.
Hello. Yes, you were right application not crash more but now it shows black/blank activity on Reports when I do next steps: When I chose test map in ListMapActivity -> go to the ReportTabActivity and chose category (where no reports) -> and then tap update button and chose someone report -> black/blank Activity.
Log: W/SurfaceView(5661): CHECK surface infomation creating=false formatChanged=false sizeChanged=false visible=false visibleChanged=true surfaceChanged=true realSizeChanged=false redrawNeeded=false left=false top=false
P.S. and I have another one question: How I can view MAP on mapTab used location by GPS mobile location but not default location?
Hello,
Am also faced same issue and rectified. Replace following code in ListReportFragment.java in
else if (status == 0){ } block at 744 line.
if(filterCategory > 0)
{
reportByCategoryList();
} else {
refreshReportLists();
}
showCategories();
if you want I can explain the reason.
Thank you. It's really work fine. And if you can explain the reason why it's happened?
P.S. and if you know how i can resolve my problem: How I can view MAP in MapFragment used location by GPS mobile location but not default location?
@reddy2401 mind sending a pull request. I'll give it a review and merge when all is good
@ml1ght you might want to check how its done in this class https://github.com/ushahidi/Ushahidi_Android/blob/develop/Core/src/com/ushahidi/android/app/MapUserLocation.java
I noticed one bug when updating reports on ReportTabActivity. When I select one of category (which no entries in it), and then click the Refresh button - there are reports of all the categories, but when I select any of them application is crashing (stored category selection to the lack of reports). I suggest when user uses refresh button reset categories value to the "All Categories" value.