--- android/EKLLauncher/src/dk/thoerup/ekllauncher/EKLLauncherActivity.java 2011/10/26 08:49:04 1623 +++ android/EKLLauncher/src/dk/thoerup/ekllauncher/EKLLauncherActivity.java 2011/10/26 09:01:56 1624 @@ -1,7 +1,9 @@ package dk.thoerup.ekllauncher; import android.app.Activity; +import android.app.AlertDialog; import android.content.Context; +import android.content.DialogInterface; import android.content.Intent; import android.location.LocationManager; import android.net.ConnectivityManager; @@ -127,10 +129,7 @@ device = ""; } - if (!locMgr.isProviderEnabled(LocationManager.GPS_PROVIDER )) { - //Settings.Secure.putString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "network,gps"); - Toast.makeText(this, "GPS er slået fra på telefonen!", Toast.LENGTH_LONG); - } + setContentView(R.layout.main); web = (WebView) findViewById(R.id.web); @@ -160,6 +159,23 @@ simHandler.sendEmptyMessage(0); + + + + if (!locMgr.isProviderEnabled(LocationManager.GPS_PROVIDER )) { + //Settings.Secure.putString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "network,gps"); + + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setMessage("GPS er slået fra på telefonen!\nSæt et flueben ved GPS i næste vindue og tryk derefter på tilbage knappen (nederst på telefonen)") + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int id) { + Intent myIntent = new Intent( Settings.ACTION_SECURITY_SETTINGS ); + startActivity(myIntent); + } + }) + .create() + .show(); + } } @Override