title: Caused by: java.lang.IllegalArgumentException: provider==null
body: <p>i have apps to access GPS... but if my GPS not enabled my apps have force close... this is my code,</p>
  
  <pre><code>private void cekGPS() {
      // TODO Auto-generated method stub
      LocationManager locationManager;
      locationManager=(LocationManager)getSystemService(Context.LOCATION_SERVICE);
      locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000L, 1.0F, this);
      boolean isGPS=locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
      //pastike sek murup po rak GPS ,e
          if(isGPS==false){
              Toast.makeText(this, "GPS gak aktip", Toast.LENGTH_LONG);
              System.out.println("GPSmati");
              startActivityForResult(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS), 0);
  
          } else {
              //lha nek wes pasti murup langsung di cek last know trus lebok2.e 
  
              System.out.println("GPSmurup");
              Toast.makeText(this, "GPS Aktif", Toast.LENGTH_LONG).show();
  
          }
  }
  </code></pre>
  
  <p>but I have error: </p>
  
  <pre><code>03-22 11:16:14.525: ERROR/AndroidRuntime(5426): Caused by: java.lang.IllegalArgumentException: provider==null
  </code></pre>
  
  <p>Can anybody help me? Thank you.</p>