summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjandegr <jandegr@users.noreply.github.com>2018-04-29 19:41:41 +0200
committerGitHub <noreply@github.com>2018-04-29 19:41:41 +0200
commit2029c4ae35135b2d2243cc099ce471670c2808b0 (patch)
treed774a2305a13c4a8a005bfc5e875b9ebd82ee5a1
parentc3a13917312f7a376656264ae2e4d509028a2481 (diff)
downloadnavit-2029c4ae35135b2d2243cc099ce471670c2808b0.tar.gz
Update Navit.java
-rw-r--r--navit/android/src/org/navitproject/navit/Navit.java26
1 files changed, 9 insertions, 17 deletions
diff --git a/navit/android/src/org/navitproject/navit/Navit.java b/navit/android/src/org/navitproject/navit/Navit.java
index f0cb5c3b5..a55fa9714 100644
--- a/navit/android/src/org/navitproject/navit/Navit.java
+++ b/navit/android/src/org/navitproject/navit/Navit.java
@@ -168,7 +168,6 @@ public class Navit extends Activity
if (os != null)
os.close();
}
- return;
}
@@ -259,7 +258,7 @@ public class Navit extends Activity
infobox.show();
SharedPreferences.Editor edit_settings = settings.edit();
edit_settings.putBoolean("firstStart", false);
- edit_settings.commit();
+ edit_settings.apply();
}
}
@@ -327,14 +326,13 @@ public class Navit extends Activity
// get the local language -------------
Locale locale = java.util.Locale.getDefault();
String lang = locale.getLanguage();
- String langu = lang;
String langc = lang;
Log.d(TAG, "lang=" + lang);
- int pos = langu.indexOf('_');
+ int pos = lang.indexOf('_');
if (pos != -1)
{
- langc = langu.substring(0, pos);
- NavitLanguage = langc + langu.substring(pos).toUpperCase(locale);
+ langc = lang.substring(0, pos);
+ NavitLanguage = langc + lang.substring(pos).toUpperCase(locale);
Log.d(TAG, "substring lang " + NavitLanguage.substring(pos).toUpperCase(locale));
// set lang. for translation
NavitTextTranslations.main_language = langc;
@@ -503,7 +501,6 @@ public class Navit extends Activity
});
infobox.show();
}
- return;
}
}
}
@@ -711,10 +708,8 @@ public class Navit extends Activity
/**
* @brief Shows the native keyboard or other input method.
- *
- * @return {@code true} if an input method is going to be displayed, {@code false} if not
*/
- public int showNativeKeyboard() {
+ public void showNativeKeyboard() {
/*
* Apologies for the huge mess that this function is, but Android's soft input API is a big
* nightmare. Its devs have mercifully given us an option to show or hide the keyboard, but
@@ -724,7 +719,7 @@ public class Navit extends Activity
Configuration config = getResources().getConfiguration();
if ((config.keyboard == Configuration.KEYBOARD_QWERTY) && (config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO))
/* physical keyboard present, exit */
- return 0;
+ return;
/* Use SHOW_FORCED here, else keyboard won't show in landscape mode */
mgr.showSoftInput(getCurrentFocus(), InputMethodManager.SHOW_FORCED);
@@ -745,7 +740,6 @@ public class Navit extends Activity
/* the receiver isn't going to fire before the UI thread becomes idle, well after this method returns */
Log.d(TAG, "showNativeKeyboard:return (assuming true)");
- return inputHeight;
}
@@ -803,7 +797,7 @@ public class Navit extends Activity
SharedPreferences prefs = this.getSharedPreferences(NAVIT_PREFS,MODE_PRIVATE);
SharedPreferences.Editor prefs_editor = prefs.edit();
prefs_editor.putString("filenamePath", newDir);
- prefs_editor.commit();
+ prefs_editor.apply();
Toast.makeText(this, String.format(Navit.T("New location set to %s\nRestart Navit to apply the changes."),newDir),Toast.LENGTH_LONG).show();
}
else Log.w(TAG, "select path failed");
@@ -834,15 +828,13 @@ public class Navit extends Activity
return true;
}
- public boolean setMapLocation()
+ public void setMapLocation()
{
Intent fileExploreIntent = new Intent(this,FileBrowserActivity.class);
fileExploreIntent
.putExtra(FileBrowserActivity.startDirectoryParameter, "/mnt")
.setAction(FileBrowserActivity.INTENT_ACTION_SELECT_DIR);
- startActivityForResult(fileExploreIntent,NavitSelectStorage_id);
-
- return true;
+ startActivityForResult(fileExploreIntent,NavitSelectStorage_id);
}
@Override