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

  • Home
  • SEARCH
  • 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 6332009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:10:53+00:00 2026-05-24T18:10:53+00:00

I’m working with google maps. When i run my app for the first time

  • 0

I’m working with google maps. When i run my app for the first time it displays a error. I click force close and app runs again and the second time it all good. This is my log cat:

08-17 07:06:35.288: ERROR/vold(26): Error opening switch name path '/sys/class/switch/test' (No such file or directory)
08-17 07:06:35.288: ERROR/vold(26): Error bootstrapping switch '/sys/class/switch/test' (No such file or directory)
08-17 07:06:35.288: ERROR/vold(26): Error opening switch name path '/sys/class/switch/test2' (No such file or directory)
08-17 07:06:35.288: ERROR/vold(26): Error bootstrapping switch '/sys/class/switch/test2' (No such file or directory)
08-17 07:06:43.888: ERROR/BatteryService(51): usbOnlinePath not found
08-17 07:06:43.888: ERROR/BatteryService(51): batteryVoltagePath not found
08-17 07:06:43.888: ERROR/BatteryService(51): batteryTemperaturePath not found
08-17 07:06:43.908: ERROR/SurfaceFlinger(51): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
08-17 07:06:47.309: ERROR/EventHub(51): could not get driver version for /dev/input/mouse0, Not a typewriter
08-17 07:06:47.309: ERROR/EventHub(51): could not get driver version for /dev/input/mice, Not a typewriter
08-17 07:06:47.539: ERROR/System(51): Failure starting core service
08-17 07:06:47.539: ERROR/System(51): java.lang.SecurityException
08-17 07:06:47.539: ERROR/System(51):     at android.os.BinderProxy.transact(Native Method)
08-17 07:06:47.539: ERROR/System(51):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
08-17 07:06:47.539: ERROR/System(51):     at android.os.ServiceManager.addService(ServiceManager.java:72)
08-17 07:06:47.539: ERROR/System(51):     at com.android.server.ServerThread.run(SystemServer.java:176)
08-17 07:06:47.548: ERROR/AndroidRuntime(51): Crash logging skipped, no checkin service
08-17 07:06:52.005: ERROR/ActivityThread(93): Failed to find provider info for android.server.checkin
08-17 07:06:52.905: ERROR/ActivityThread(93): Failed to find provider info for android.server.checkin
08-17 07:06:52.974: ERROR/ActivityThread(93): Failed to find provider info for android.server.checkin
08-17 07:06:54.728: ERROR/vold(26): Cannot start volume '/sdcard' (volume is not bound)
08-17 07:06:54.934: ERROR/MediaPlayerService(30): Couldn't open fd for content://settings/system/notification_sound
08-17 07:06:54.944: ERROR/MediaPlayer(51): Unable to to create media player
08-17 07:06:57.375: ERROR/ActivityThread(51): Failed to find provider info for com.google.settings
08-17 07:06:57.375: ERROR/ActivityThread(51): Failed to find provider info for com.google.settings
08-17 07:07:00.225: ERROR/AndroidRuntime(207): ERROR: thread attach failed
08-17 07:07:01.955: ERROR/AndroidRuntime(220): ERROR: thread attach failed
08-17 07:07:07.805: ERROR/ActivityThread(233): Failed to find provider info for com.google.settings
08-17 07:07:07.805: ERROR/ActivityThread(233): Failed to find provider info for com.google.settings
08-17 07:07:07.885: ERROR/ActivityThread(233): Failed to find provider info for com.google.settings
08-17 07:07:08.265: ERROR/AndroidRuntime(233): Uncaught handler: thread main exiting due to uncaught exception
08-17 07:07:08.275: ERROR/AndroidRuntime(233): java.lang.RuntimeException: Unable to start activity ComponentInfo{test.projekat/test.projekat.TrenutnaLokacija}: java.lang.NullPointerException
08-17 07:07:08.275: ERROR/AndroidRuntime(233):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
08-17 07:07:08.275: ERROR/AndroidRuntime(233):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
08-17 07:07:08.275: ERROR/AndroidRuntime(233):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)
08-17 07:07:08.275: ERROR/AndroidRuntime(233):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
08-17 07:07:08.275: ERROR/AndroidRuntime(233):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-17 07:07:08.275: ERROR/AndroidRuntime(233):     at android.os.Looper.loop(Looper.java:123)
08-17 07:07:08.275: ERROR/AndroidRuntime(233):     at android.app.ActivityThread.main(ActivityThread.java:4363)
08-17 07:07:08.275: ERROR/AndroidRuntime(233):     at java.lang.reflect.Method.invokeNative(Native Method)
08-17 07:07:08.275: ERROR/AndroidRuntime(233):     at java.lang.reflect.Method.invoke(Method.java:521)
08-17 07:07:08.275: ERROR/AndroidRuntime(233):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-17 07:07:08.275: ERROR/AndroidRuntime(233):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-17 07:07:08.275: ERROR/AndroidRuntime(233):     at dalvik.system.NativeStart.main(Native Method)
08-17 07:07:08.275: ERROR/AndroidRuntime(233): Caused by: java.lang.NullPointerException
08-17 07:07:08.275: ERROR/AndroidRuntime(233):     at test.projekat.TrenutnaLokacija.onCreate(TrenutnaLokacija.java:91)
08-17 07:07:08.275: ERROR/AndroidRuntime(233):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-17 07:07:08.275: ERROR/AndroidRuntime(233):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
08-17 07:07:08.275: ERROR/AndroidRuntime(233):     ... 11 more

My issue is:

08-17 07:07:08.275: ERROR/AndroidRuntime(233): Caused by: java.lang.NullPointerException
    08-17 07:07:08.275: ERROR/AndroidRuntime(233):     at test.projekat.TrenutnaLokacija.onCreate(TrenutnaLokacija.java:90)

firstDot = new GeoPoint((int) (location.getLatitude()*1E6),(int) (location.getLongitude()*1E6));

I edited question…this is my code…location is null..I started my app on android phone and it doesn’t work…

public void onCreate(Bundle savedInstance){
        super.onCreate(savedInstance);
        setContentView(R.layout.pocetna);

        mapView = (MapView) findViewById(R.id.mapview);     
        textView = (TextView) findViewById(R.id.text1);     
        textView3 = (TextView) findViewById(R.id.textView2);
        mapController = mapView.getController();
        mapController.setZoom(17);      
        mapView.setStreetView(true);
        mapView.setBuiltInZoomControls(true);
        button = (Button) findViewById(R.id.button1);
        //mapView.setSatellite(true);       
        sb = (SeekBar) findViewById(R.id.seekBar1);

        locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);

        locationListener = new LocationListener() {

            @Override
            public void onStatusChanged(String provider, int status, Bundle extras) {

            }

            @Override
            public void onProviderEnabled(String provider) {                

            }

            @Override
            public void onProviderDisabled(String provider) {
                updateWithNewLocation(null);

            }

            @Override
            public void onLocationChanged(Location location) {              
//              TrenutnaLokacija.this.location =  location;
                updateWithNewLocation(location);    

            }
        };

        Criteria criteria = new Criteria();
        criteria.setPowerRequirement(Criteria.POWER_LOW);
        criteria.setAccuracy(Criteria.ACCURACY_FINE);
        provider = locationManager.getBestProvider(criteria, true);

        locationManager.requestLocationUpdates(provider, 0, 0, locationListener);


        try{
            location = locationManager.getLastKnownLocation(provider);

        }catch (IllegalArgumentException e) {
            Log.d("location", "Greska", e);
        }catch (SecurityException s) {
            Log.d("dsds", "Greska", s);
        }

        AlertDialog ad1 = new AlertDialog.Builder(this).create();
        ad1.setTitle("Greska");
        ad1.setMessage("Trenutno nisu ucitane lokacije");
        ad1.setButton(DialogInterface.BUTTON_POSITIVE, "Dozvoli", new DialogInterface.OnClickListener() {

            @Override
            public void onClick(DialogInterface ad, int which) {

            }
        });

        if(location == null){
            ad1.show();
            Intent i = new Intent(TrenutnaLokacija.this, PronadjiKlopuActivity.class);
            startActivity(i);
        }



        GeoPoint firstDot = new GeoPoint((int) (location.getLatitude()*1E6),(int) (location.getLongitude()*1E6));

        myPosition = new NewItemizedOverlay(getResources().getDrawable(R.drawable.map_pin), firstDot);
        listOfOverlays = mapView.getOverlays();
        listOfOverlays.clear();
        listOfOverlays.add(myPosition);
  • 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-24T18:10:54+00:00Added an answer on May 24, 2026 at 6:10 pm

    You have a Null Pointer Exception in the TrenutnaLokacija class on line 91

    This is usually when you haven’t instantiated a variable yet, or you are retrieving from sharedpreferences or other class call where it returns null if what you specify isn’t found.

    http://www.javacoffeebreak.com/articles/toptenerrors.html Please see Number 1!

    EDIT

    Because you say it runs fine second time, it sounds like your trying to get a location but it has not loaded yet in your onCreate()

    It is possible location is null here:

     location.getLatitude();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want use html5's new tag to play a wav file (currently only supported
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

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.