--- android/EKLLauncher/src/dk/thoerup/ekllauncher/EKLLauncherActivity.java 2011/10/25 17:24:09 1622 +++ android/EKLLauncher/src/dk/thoerup/ekllauncher/EKLLauncherActivity.java 2011/10/26 08:49:04 1623 @@ -3,6 +3,7 @@ import android.app.Activity; import android.content.Context; import android.content.Intent; +import android.location.LocationManager; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Bundle; @@ -34,12 +35,6 @@ } - @Override - public boolean onCreateWindow(WebView view, boolean dialog, boolean userGesture, Message resultMsg) { - msg("create window"); - return super.onCreateWindow(view, dialog, userGesture, resultMsg); - } - public void onProgressChanged(WebView view, int progress) { // Activities and WebViews measure progress with different scales. @@ -90,15 +85,13 @@ static final String URL = "http://omdeling.info/mobil/ekl/login.php"; + LocationManager locMgr; ConnectivityManager connMgr; TelephonyManager telMgr; WebView web; String device = ""; - public void msg(String m) { - Toast.makeText(EKLLauncherActivity.this, m, Toast.LENGTH_SHORT).show(); - } /** Called when the activity is first created. */ @Override @@ -122,7 +115,7 @@ - + locMgr = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE); telMgr = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE); connMgr = (ConnectivityManager) this.getSystemService(Context.CONNECTIVITY_SERVICE); @@ -134,6 +127,10 @@ 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);