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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:50:21+00:00 2026-06-17T20:50:21+00:00

I am currently working on the new Google Maps Android API v2. My MapActivity

  • 0

I am currently working on the new Google Maps Android API v2.

My MapActivity class is working with my Samsung galaxy s3 ans s2 with the code below:

However, there are some particular devices are not working such as: GT-S5830i

class MapActivity extends FragmentActivity  implements OnMapClickListener, OnMapLongClickListener, OnMarkerClickListener
{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_map);

                tvLocInfo = (TextView)findViewById(R.id.locinfo);

                android.support.v4.app.FragmentManager myFragmentManager = getSupportFragmentManager();
                SupportMapFragment myMapFragment = (SupportMapFragment)myFragmentManager.findFragmentById(R.id.map);
                myMap = myMapFragment.getMap();

                myMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);
                ArrayList<Cooridnates> cooridnatesList = MainActivity.getList();
                for(int i=0;i<cooridnatesList.size();i++)
                {
                    //Toast.makeText(MapActivity.this, "SIZE : " + " " + cooridnatesList.size(), Toast.LENGTH_LONG).show();
                    LatLng point = new LatLng(cooridnatesList.get(i).getLat(),cooridnatesList.get(i).getLon());
                    tvLocInfo.setText("markers added");
                    myMap.addMarker(new MarkerOptions().position(point).title(point.toString()));
                    center=CameraUpdateFactory.newLatLng(point);
                }

                CameraUpdate zoom=CameraUpdateFactory.zoomTo(16);
                myMap.moveCamera(center);
                myMap.animateCamera(zoom);
                myMap.setOnMapClickListener(this);
                myMap.setOnMarkerClickListener(this);
                markerClicked = false;
             }

For some reason, I am getting this error:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.coldice.plotfinder/com.coldice.plotfinder.MapActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.google.android.gms.maps.GoogleMap.moveCamera(Unknown Source)
at com.coldice.plotfinder.MapActivity.onCreate(MapActivity.java:70)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
... 11 more
  • 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-17T20:50:22+00:00Added an answer on June 17, 2026 at 8:50 pm

    You function MainActivity.getList() probably returned an empty list, so for loop doesn’t execute center=CameraUpdateFactory.newLatLng(point);.

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

Sidebar

Related Questions

I'm currently working with Google Maps API v3, with jQuery, and MarkerClusterer. I note
I'm currently working on an ASP.NET project where I'm using the Google Maps API
I am currently working on an application for Android 2.1-update1 with the Google API
I'm very new at using JS and AJAX. Currently I'm working with Google Maps
I'm currently working with the Google Maps V3 API, and I'm animating a marker
Currently, I am working on restructuring an existing code base. I'm new to php
For a Christmas Market, I'm currently working on a Google Maps map. I load
In general my Google Maps API V3 / Javascript application is working fine. I
Currently working on a project to upgrade our Goole Maps API from v2 to
I am currently working on google map api V3 using cakephp with prototype.js. I

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.