I have a very simple spinner in which I show two values ββ1 => English 2 => Hebrew
and I restart all activity (to change the interface) when I select any value from the counter, but the problem is that my activity restarts only for case 1, only help me figure out the problem.
Here is the code I'm using
languageSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (!isFistLaunch) { String email = mEmailEditText.getText().toString(); String pass = mPasswordEditText.getText().toString(); Intent intent = new Intent(MainActivity.this, MainActivity.class); intent.putExtra("typed_email", email); intent.putExtra("typed_pass", pass); mUserSession.setUserLanguage(lang[position]); Toast.makeText(MainActivity.this, "Spinner position = " + position, Toast.LENGTH_SHORT).show(); startActivity(intent); MainActivity.this.finish(); } else { isFistLaunch = false; } } @Override public void onNothingSelected(AdapterView<?> parent) { } });
I also put a toast on its side, but it only shows once ...
Spinner works the way I want, but only on my device. all other devices do not show Hebrew toasts. They only show a toast for English.
Can anyone tell me what the problem is? Thanks
android android spinner
Mustanser Iqbal Dec 21 '15 at 10:09 2015-12-21 10:09
source share