/ Published in: Java
Expand |
Embed | Plain Text
private void Check(){ Settings.Secure.LOCATION_PROVIDERS_ALLOWED); if(!provider.contains("gps")){ // if gps is disabled new AlertDialog.Builder( this ) .setTitle( "Turn GPS" ) .setMessage( "The GPS is off you activate it ?" ) .setPositiveButton( "Yes", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { startActivity(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS)); }}) .setNegativeButton( "No", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { }} ) .show(); } }
You need to login to post a comment.
