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 8134625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:06:06+00:00 2026-06-06T10:06:06+00:00

In My application seldom not always, nullpointer exception on zooming of goggle map I

  • 0

In My application seldom not always, nullpointer exception on zooming of goggle map
I have put check condition but issue still remain please anyone help me stacktrace is:-

06-25 20:02:31.207: W/System.err(10102): java.lang.NullPointerException
06-25 20:02:31.207: W/System.err(10102):    at com.google.android.maps.ItemizedOverlay.populate(ItemizedOverlay.java:312)
06-25 20:02:31.207: W/System.err(10102):    at com.rentfaster.home.GoogleMapView$GoogleMapViewOverlay.addItem(GoogleMapView.java:1668)
06-25 20:02:31.211: W/System.err(10102):    at com.rentfaster.home.GoogleMapView$Mapdatatask.onPostExecute(GoogleMapView.java:1417)
06-25 20:02:31.211: W/System.err(10102):    at com.rentfaster.home.GoogleMapView$Mapdatatask.onPostExecute(GoogleMapView.java:1)
06-25 20:02:31.215: W/System.err(10102):    at android.os.AsyncTask.finish(AsyncTask.java:602)
06-25 20:02:31.218: W/System.err(10102):    at android.os.AsyncTask.access$600(AsyncTask.java:156)
06-25 20:02:31.218: W/System.err(10102):    at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:615)
06-25 20:02:31.218: W/System.err(10102):    at android.os.Handler.dispatchMessage(Handler.java:99)
  06-25 20:02:31.222: W/System.err(10102):  at android.os.Looper.loop(Looper.java:137)
  06-25 20:02:31.222: W/System.err(10102):  at android.app.ActivityThread.main(ActivityThread.java:4424)
  06-25 20:02:31.222: W/System.err(10102):  at java.lang.reflect.Method.invokeNative(Native Method)
  06-25 20:02:31.226: W/System.err(10102):  at java.lang.reflect.Method.invoke(Method.java:511)
   06-25 20:02:31.226: W/System.err(10102):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
   06-25 20:02:31.226: W/System.err(10102):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
    06-25 20:02:31.230: W/System.err(10102):    at dalvik.system.NativeStart.main(Native Method)

This issue is not comming each time that’s why I unable to find what’s wrong please anyone see my code and suggest me:-

    @Override
    protected void onPostExecute(Integer result) 
    {
        if(!valueoftotal.equalsIgnoreCase("") && !valueoftotal.equalsIgnoreCase(null))
        {
            if(Integer.parseInt(valueoftotal) > 0 && Integer.parseInt(valueoftotal) <= 100)
            {
                OverlayItem oi;
                if(myHandler.getParsedData()!=null)
                {
                    arrayList = myHandler.getParsedData();      
                }
                linearbottom2.setClickable(true);
                mapOverlays.clear();
                overlay.removeAll();
                lineartabbar.setBackgroundResource(R.drawable.mapbar);

                if(arrayList.size()!=0 && arrayList.size()>1  )
                {
                    for(int i = 0; i < arrayList.size(); i++) { 

                        String latvalue = arrayList.get(i).getLatitude().toString();
                        String lonvalue = arrayList.get(i).getLongitude().toString();


                        GeoPoint point = null;

                        try
                        {
                            point = new GeoPoint((int)(Double.parseDouble(latvalue)*1E6),(int)(Double.parseDouble(lonvalue)*1E6));
                        }
                        catch (NumberFormatException e) 
                        {
                        }

                        if(point != null)
                        {
                            if(arrayList.get(i).getUnitstotal().equalsIgnoreCase("1"))
                            {  
                                oi = overlay.createItem(i);
                                if(overlay!=null && oi!=null)
                                {
                                overlay.addItem(oi);
                                }
                            }
                            else if(!arrayList.get(i).getUnitstotal().equalsIgnoreCase("1"))
                            {
                                oi = overlay.createItem(i);
                                if(overlay!=null && oi!=null)
                                {
                                    overlay.addItem(oi);

                                }

                            }
                        }
                    }
                    mapOverlays.add(overlay);
                    mapView.invalidate();

                }
                else if( arrayList.size()!=0 && arrayList.size()==1 )
                {
                    for(int i = 0; i < arrayList.size(); i++) { 

                        String latvalue = arrayList.get(i).getLatitude().toString();
                        String lonvalue = arrayList.get(i).getLongitude().toString();

                        GeoPoint point = null;
                        try
                        {
                            point = new GeoPoint((int)(Double.parseDouble(latvalue)*1E6),(int)(Double.parseDouble(lonvalue)*1E6));
                        }
                        catch (NumberFormatException e) {
                            // TODO: handle exception
                        }

                        if(point != null)
                        {
                            if(arrayList.get(i).getUnitstotal().equalsIgnoreCase("1"))
                            {  

                                oi = overlay.createItem(i);
                                System.out.println("listing when 1 value is  "+arrayList.get(i).getUnitstotal());

                                overlay.addItem(oi);
                                mc.animateTo(point);
                                mc.setCenter(point);
                                mc.setZoom(16);
                            }
                            else if(!arrayList.get(i).getUnitstotal().equalsIgnoreCase("1"))
                            {

                                oi = overlay.createItem(i);
                                System.out.println("listing when more value is  "+ arrayList.get(i).getUnitstotal());

                                overlay.addItem(oi);
                                mc.animateTo(point);
                                mc.setCenter(point);
                                mc.setZoom(12);

                            }
                        }
                    }

                    mapOverlays.add(overlay);
                    mapView.invalidate();

                    MapController mcontrller =mapView.getController();

                    /*mcontrller.animateTo(arg0)
                    mcontrller.setCenter();
                    mcontrller.setZoom(zoomLevel);
                    */

                }

                textViewpopup.setText(valueoftotal+" listings found.");
                linearlayoutpopup.setVisibility(View.VISIBLE);
                RunAnimationslisting();

            }
            else if(Integer.parseInt(valueoftotal) > 100)
            {

                Eyelidmessage(valueoftotal+" listings found. \n Zoom-in, press the locate button below or select the refine button above to display fewer properties. ");
                lineartabbar.setBackgroundResource(R.drawable.mapwithoutlist);
                linearbottom2.setClickable(false);                  

            }
            else if(Integer.parseInt(valueoftotal) == 0)
            {
                GoneAnimations();
                lineartabbar.setBackgroundResource(R.drawable.mapwithoutlist);
                linearbottom2.setClickable(false);
                customizeDialog = new CustomizeDialog(activity);  
                customizeDialog.setTitle("Sorry");  
                customizeDialog.setMessage("No Listing Found");  
                customizeDialog.show();
            }
        }

        super.onPostExecute(result);
    }

sorry for my explaination.

  • 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-06-06T10:06:08+00:00Added an answer on June 6, 2026 at 10:06 am

    instead of writing

    protected void onPostExecute(Integer result) 
    {
        if(!valueoftotal.equalsIgnoreCase("") && !valueoftotal.equalsIgnoreCase(null))
        {
        }
    }
    

    Try this one

    protected void onPostExecute(Integer result) 
    {
        if(valueoftotal!=null)
        if(!valueoftotal.equalsIgnoreCase(""))
        {
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Application able to record error in OnError, but we are not able to do
An application I have recently started work on has to register two dll's, because
Greetings. I have a .NET application running a bunch of simulations in parallel. It's
The application I'm currently writing is using MVVM with the ViewModel-first pattern. I have
application = webapp.WSGIApplication( [(r'/main/profile/([a-f0-9]{40})', ProfileHandler)], debug=True) The regex in the above parameter will not
Application uses Entity Framework 4.1 with database first approach. I have in database a
Application Error An error occurred in the application and your page could not be
Application.Run(form); Actually I tried to call this from my project. I got this exception.
application for project .....csproj is not installed. Make sure the application for the project
Application failed codesign verification. The signature was invalid, or it was not signed with

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.