[Android] GPS State Check and Show AlertDialog
private boolean turnGPSOn() { String gps = android.provider.Settings.Secure.getString(getContentResolver(), android.provider.Settings.Secure.LOCATION_PROVIDERS_ALLOWED); if (!(gps.matches(".*gps.*") && gps.matches(".*network.*"))) { // GPS OFF 일때 Dialog 표시 AlertDialog.Builder gsDialog = new AlertDialog.Builder(this); gsDialog.setTitle("위치 서비스 설정"); gsDialog.setMessage("무선 네트워크 사용, GPS 위성 사용을 모두 ..
2014. 9. 5. 10:10