title: java.lang.NullPointerException Error While trying to get Location
body: <p>I am trying to make an application that takes the location and sends that data, everything was fine till 10 min ago. Now I got an error and I couldn't find what it is. Any help, thank you...</p>
  
  <p>Some of my codes below...</p>
  
  <pre><code>...
  ...
       Location mCurrentLocation;
  
  private final static int
          CONNECTION_FAILURE_RESOLUTION_REQUEST = 9000;
  LocationClient mLocationClient;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      Button b = (Button) findViewById(R.id.button1);
      b.setOnClickListener(this);
      /*
       * Create a new location client, using the enclosing class to
       * handle callbacks.
       */
      mLocationClient = new LocationClient(this, this, this);
  }
  
  
  
  ...
  ...
  
  
      @Override
      public void onClick(View arg0) {
          // TODO Auto-generated method stub
          TextView tv = (TextView) findViewById(R.id.textView1);
           mCurrentLocation = mLocationClient.getLastLocation();
          tv.setText("slm"+mCurrentLocation.getLatitude());
      }
  </code></pre>
  
  <p>And the error I get is ...</p>
  
  <pre><code>09-19 10:58:10.320: E/AndroidRuntime(1542): FATAL EXCEPTION: main
  09-19 10:58:10.320: E/AndroidRuntime(1542): java.lang.NullPointerException
  09-19 10:58:10.320: E/AndroidRuntime(1542):     at com.example.testapplication.MainActivity.onClick(MainActivity.java:186)
  09-19 10:58:10.320: E/AndroidRuntime(1542):     at android.view.View.performClick(View.java:2538)
  09-19 10:58:10.320: E/AndroidRuntime(1542):     at android.view.View$PerformClick.run(View.java:9152)
  09-19 10:58:10.320: E/AndroidRuntime(1542):     at android.os.Handler.handleCallback(Handler.java:587)
  09-19 10:58:10.320: E/AndroidRuntime(1542):     at android.os.Handler.dispatchMessage(Handler.java:92)
  09-19 10:58:10.320: E/AndroidRuntime(1542):     at android.os.Looper.loop(Looper.java:130)
  09-19 10:58:10.320: E/AndroidRuntime(1542):     at android.app.ActivityThread.main(ActivityThread.java:3693)
  09-19 10:58:10.320: E/AndroidRuntime(1542):     at java.lang.reflect.Method.invokeNative(Native Method)
  09-19 10:58:10.320: E/AndroidRuntime(1542):     at java.lang.reflect.Method.invoke(Method.java:507)
  09-19 10:58:10.320: E/AndroidRuntime(1542):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
  09-19 10:58:10.320: E/AndroidRuntime(1542):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
  09-19 10:58:10.320: E/AndroidRuntime(1542):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>