Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7651849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:36:32+00:00 2026-05-31T11:36:32+00:00

I would like to ask for some help to understand an error report. I

  • 0

I would like to ask for some help to understand an error report. I have an app uploaded on the Android market, or so called Google Play theese days, and one of my user had a force close, and pressed the “Report” button, so I recieved his report. What I know:

  • it must come from the MapActivity of my app
  • I have custom markers on the map
  • at the time of the report, the site could be down from where I would fetch the data for the markers, so it is possible, that there was 0 alive marker at the time of the report
  • I think that there is no possible nullpointer errors on my side, I think I have it all covered
  • the maximum numbers of the markers is 1(yea it sounds silly for now, I will change it in the future tho, so it is fine that the app can handle multiple markers)
  • the error report does not contain ANY reference to my code, the Stacktrace is pointing on the android maps
  • from what I understand, some zooming action could cause the whole thing, not sure tho

The mentioned stacktrace:

java.lang.NullPointerException
at android.graphics.Canvas.<init>(Canvas.java:82)
at com.google.android.maps.ZoomHelper.createSnapshot(ZoomHelper.java:447)
at com.google.android.maps.ZoomHelper.doZoom(ZoomHelper.java:151)
at com.google.android.maps.ZoomHelper.doZoom(ZoomHelper.java:140)
at com.google.android.maps.MapView.doZoom(MapView.java:1478)
at com.google.android.maps.MapView.doZoom(MapView.java:1487)
at com.google.android.maps.MapView$6.onZoom(MapView.java:1442)
at android.widget.ZoomButtonsController$3.onClick(ZoomButtonsController.java:268)
at android.view.View.performClick(View.java:2420)
at android.view.View$PerformClick.run(View.java:8844)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)

I have no idea what to do, even tho there is only this 1 report from 2000~ users, it still bugs me, and I would like to have it covered, and it is always good, to learn something new at the end of the day. 🙂

Some snippets from my code:

This is how I create the Map:

protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.map);

    isCentered=false;

    map = (MapView)findViewById(R.id.map_view);

    map=(MapView)findViewById(R.id.map_view);
    map.setBuiltInZoomControls(true);

    extras = this.getIntent().getExtras();
    if(extras!=null) code=extras.getString("code");

    if(!isOnline())
    {
        Toast.makeText(this, "Aktív internetkapcsolat szükséges!", Toast.LENGTH_SHORT).show();
        return;
    }

    refreshTrain();
}

After creating the map, the refreshTrain() method starts an AsyncTask, which fetches the data from a website, and sets up the markers in the onPostExecute(Void param) like this:

    protected void onPostExecute(Void param)
    {
        try 
        {
            if(result.length()<10) //the site is offline or the request is not valid
            {
                Toast.makeText(ctx, "Nem érhetőek el a térképadatok, próbáld később...", Toast.LENGTH_SHORT).show();
                return;
            }
            JSONObject json = new JSONObject(result); //parse the result and set up the coordinates
            latitude=json.getString("lat");
            longitude=json.getString("lon");
            double _lat=Double.parseDouble(latitude);
            double _lon=Double.parseDouble(longitude);
            int lat=(int)(_lat*1E6);
            int lon=(int)(_lon*1E6);

            event_time=getJson(json, "event_time"); //get additional informations about the train
            start_station=getJson(json, "start_station");
            end_station=getJson(json, "end_station");

            MapController mc = map.getController(); //set the markers
            List<Overlay> list = map.getOverlays();
            list.clear();
            Drawable drawable = getResources().getDrawable(R.drawable.pin);
            Markers markers = new Markers(drawable);
            GeoPoint p = new GeoPoint(lat, lon);
            OverlayItem item = new OverlayItem(p, "vonat", "snippet");
            markers.addOverlayItem(item);
            mc.setCenter(p);
            mc.animateTo(p);
            if(!isCentered) //dont change the zoom after each refresh, only on the first creation
            {
                mc.setZoom(12);
                isCentered=true;
            }

            list.add(markers);
        }
        catch(JSONException e)
        {
            Log.e(TAG,e.getMessage());
        }

    }
}

Finally, my marker class is looking like this:

private class Markers extends com.google.android.maps.ItemizedOverlay<OverlayItem> {
    private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>();

    public Markers(Drawable defaultMarker) {
        super(boundCenter(defaultMarker));
    }

    @Override
    protected OverlayItem createItem(int i) {
        return mOverlays.get(i);
    }

    @Override
    public int size() {
        return mOverlays.size();
    }

    public void addOverlayItem(OverlayItem item)
    {
        mOverlays.add(item);
        populate();
    }

    @Override
    protected boolean onTap(int index) { //display the additional infos on tap
      AlertDialog.Builder dialog = new AlertDialog.Builder(ctx);
      dialog.setTitle("Frissítve: "+event_time);
      dialog.setMessage(start_station+" \u2192 "+end_station);
      dialog.show();
      return true;
    }

}

cheers

edit: code added

edit2: from what I’ve found so far(nothing sure) the error could come from the Toast message. At the errors time, I wouldnt check if there is any active connection(no isOnline() in the onCreate), and wouldn’t notify the user, if the site isnt available, so if it is the Toast, it is coming from the refreshing thingie in the AsyncTask, which is fired in the onPreExecute() method, nothing else happens there. Im only guessing, but maybe…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T11:36:34+00:00Added an answer on May 31, 2026 at 11:36 am

    Since this error never ever showed up again, I consider it as a non-issue, even tho I never found out what caused it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good morning! I would like to ask some help from you guys on how
I would like to ask some logic question here. Let say I have a
i would like to ask some help from you guys. i am making a
I have two list operations which I would like to ask for help. The
I would like to ask, I have a window called MainWindow and another one
I would like to ask some help. This is not homework but it is
I would like to ask some Drupaler for help. Is it possible to show
I would like to ask for some simple examples showing the uses of <div>
I would like ask if there's a way to download an android layout from
I would like to ask for a reccomended solution for this: We have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.