Android Open Source - SpeedMeter Permission Gps






From Project

Back to project page SpeedMeter.

License

The source code is released under:

GNU General Public License

If you think the Android project SpeedMeter listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package fly.speedmeter.grub;
//from  ww  w.j a v  a2 s  .c om
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;

import fly.speedmeter.grub.R;

public class PermissionGps extends Activity {

  
    private void createGpsDisabledAlert() {
        AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
        localBuilder
            .setMessage(R.string.activate_gps)
            .setCancelable(false)
            .setPositiveButton(R.string.go_to_gps,
                new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface paramDialogInterface, int paramInt) {
                        PermissionGps.this.showGpsOptions();
                    }
                }
            );
        localBuilder.create().show();
    }

    private void showGpsOptions() {
        startActivity(new Intent("android.settings.LOCATION_SOURCE_SETTINGS"));
        finish();
    }

    protected void onCreate(Bundle paramBundle) {
        super.onCreate(paramBundle);
        setContentView( R.layout.activity_main );
        createGpsDisabledAlert();
    }
}




Java Source Code List

fly.speedmeter.grub.GpsServices.java
fly.speedmeter.grub.InfosView.java
fly.speedmeter.grub.MainActivity.java
fly.speedmeter.grub.PermissionGps.java
fly.speedmeter.grub.Settings.java