ushahidi / Ushahidi_Android

[Deprecated] Ushahidi Android app For Ushahidi V2.x.x. Working on V3.x.x at
https://github.com/ushahidi/platform-android/
GNU Lesser General Public License v3.0
202 stars 153 forks source link

app crashes when opening my crowdmap #108

Closed petjal closed 11 years ago

petjal commented 11 years ago

Hi, On my Galaxy S III, Android version 4.1.1 (SCH-I535, d2vzw) , the Ushahidi v3.1.4 crashes whenever I open my little experimental CrowdMap, http://nbpt.crowdmap.com . Opening the other sites seem to work fine. I've submitted the app crash report. The report contains "Exception class name: java.lang.NumberFormatException, StringToRealJava, invalidReal, line number 63". The site works fine in mobile mode on a browser on my Android device, as well as on my computer in any browser. Thanks for all your hard work, Pete

Edit: looking closer at the crash report, it looks like the problem is at line 313 of com.ushahidi.android.app.ui.tablet.MapFragment in the populateMap() method, when trying to parse the Double for getLatitude.

/**
 * add marker to the map
 */
public void populateMap() {
    Drawable marker = getResources().getDrawable(R.drawable.map_marker_red);
    marker.setBounds(0, 0, marker.getIntrinsicWidth(),
            marker.getIntrinsicHeight());
    itemOverlay = new ReportMapItemizedOverlay<ReportMapOverlayItem>(
            marker, map, getActivity());
    if (mReportModel != null) {
        for (ListReportModel reportModel : mReportModel) {
            itemOverlay.addOverlay(new ReportMapOverlayItem(getPoint(
                    Double.valueOf(reportModel.getLatitude()),
                    Double.valueOf(reportModel.getLongitude())),
                    reportModel.getTitle(), Util.limitString(
                            reportModel.getDesc(), 30), reportModel
                            .getThumbnail(), reportModel.getId(), ""));
        }
    }
petjal commented 11 years ago

My Verizon Samsung Galaxy S III auto-updated the Ushahidi app this morning to v3.1.5 and this bug is fixed. My test crowdmap site works fine now.

Thanks! Pete