ChooseLanguage.java
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
import picker.novasyslabs.com.picker.R;
import picker.novasyslabs.com.picker.SplashScreen;
import picker.novasyslabs.com.picker.Volley.RegisterUser;
public class ChooseLanguage extends AppCompatActivity {
ArrayAdapter adapter;
ListView choose_lang;
String[] languagelist;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
languagelist = getResources().getStringArray(R.array.Langusges);
setContentView(R.layout.activity_choose_language);
adapter = new ArrayAdapter<String>(this,R.layout.language_list,languagelist);
choose_lang = (ListView) findViewById(R.id.languages);
choose_lang.setAdapter(adapter);
choose_lang.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
SplashScreen.Language = parent.getItemAtPosition(position).toString();
Toast.makeText(getApplicationContext(),SplashScreen.Language,Toast.LENGTH_SHORT).show();
RegisterUser registerUser = new RegisterUser();
}
});
}
}
的strings.xml
<array name="Langusges">
<item>हिंदी</item>
<item>తెలుగు</item>
<item>தமிழ்</item>
<item>മലയാളം</item>
<item>ಕನ್ನಡ</item>
<item>English</item>
<item>मराठी</item>
<item>বাংলা</item>
<item>ગુજરાતી</item>
<item>ਪੰਜਾਬੀ</item>
<item>ଓଡିଆ</item>
<item>भोजपुरी</item>
<item>नेपाली</item>
<item>हरयनवी</item>
<item>कश्मीरी</item>
<item>অসমীয়া</item>
<item>कोंकणी</item>
</array>
我得到的结果:
所有语言都在显示,但是如图所示,3种语言没有显示,即使我点击该项目,空白也会被烘烤,当我点击其他语言时,会显示点击的语言。在我的标签中,它没有显示3种语言和其他索尼电话显示其他语言只显示一种语言,但这是另一种语言。
任何帮助将不胜感激。 谢谢!
答案 0 :(得分:0)
您的标签不支持这些语言。但是您正在测试的其他设备会这样做。