mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
Add string resources
This commit is contained in:
parent
e8f306a023
commit
faa60dc824
2 changed files with 10 additions and 9 deletions
|
|
@ -91,24 +91,23 @@ public class NearbyActivity extends BaseActivity {
|
|||
|
||||
|
||||
protected void checkGps() {
|
||||
LocationManager manager = (LocationManager)
|
||||
getSystemService(LOCATION_SERVICE);
|
||||
if(!manager.isProviderEnabled( LocationManager.GPS_PROVIDER )) {
|
||||
LocationManager manager = (LocationManager) getSystemService(LOCATION_SERVICE);
|
||||
if (!manager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
|
||||
Timber.d("GPS is not enabled");
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
|
||||
alertDialogBuilder.setMessage("GPS is disabled in your device. Would you like to enable it?")
|
||||
alertDialogBuilder.setMessage(R.string.gps_disabled)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton("Enable GPS",
|
||||
new DialogInterface.OnClickListener(){
|
||||
public void onClick(DialogInterface dialog, int id){
|
||||
.setPositiveButton(R.string.enable_gps,
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
Intent callGPSSettingIntent = new Intent(
|
||||
android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
|
||||
startActivity(callGPSSettingIntent);
|
||||
}
|
||||
});
|
||||
alertDialogBuilder.setNegativeButton("Cancel",
|
||||
new DialogInterface.OnClickListener(){
|
||||
public void onClick(DialogInterface dialog, int id){
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue