![]() ![]() setSingleChoiceItems(Language, lang_selected, new DialogInterface. ![]() Public static Context onAttach(Context context) įinal AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MainActivity.this) ĭtTitle("Select a Language") Private static final String SELECTED_LANGUAGE = "" This class will help you in getting and storing language that a user has previously selected before he close the application, we will use SharedPreferences to store the locale selected by user in app. Now create new java file and name it as Localehelper and add the below code ![]() Android spinner is associated with AdapterView. Touching the spinner displays a drop down menu with all other available values, from which the user can select a new one. In the default state, a spinner shows its currently selected value. Likewise you can add different language that you want to add into your android applicaton. In Android, Spinner is used to select one value from a set of values. String.xml (kn) for Kannada language in your app. String.xml (hi) for hindi language in your android app. Now in those strings.xml file add the translated strings ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |