For some reason my code when I exit crashes my phone... so if I am paused or never start my app and hit the Quit command it crashes but if the app is running and I quit then it exits fine... my question is why and what is the fix...[HIGH]public void onClick(View arg0) { switch (arg0.getId()) { case R.id.retrieve_location_button: showCurrentLocation(); break; case R.id.bTrack: if (isTracking) { pause(); } else { resume(); } break; case R.id.bQuit: quit(); break; private void resume() { isTracking = true; trackbutton.setText("Stop Tracking"); startTracking(); } public void pause() { Log.d(LOG_TAG, "stopTracking()"); isTracking = false; trackbutton.setText("Start Tracking"); locationManager.removeUpdates(locationListener); } private void quit() { pause(); // remove username in prefs LoginInData.prefs.edit().remove("lbsusername").remove("lbspass") .remove("lbsgroup").commit(); finish(); }[/HIGH]