我正在尝试将值从数组设置为微调器,但它适用于少数而不适用于其他人。请帮帮我。这是我的代码。
edmORdelOF = (Spinner) findViewById(R.id.ed_sign_up_manf_del_of);
ArrayAdapter<CharSequence> adapterItem = ArrayAdapter.createFromResource(this,
R.array.Item, android.R.layout.simple_spinner_item);
adapterItem.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
edmORdelOF.setAdapter(adapterItem);
System.out.println(profile.getEdmORdelOF()+"....getPosition..........."+adapterItem.getPosition(profile.getEdmORdelOF()));
edmORdelOF.setSelection(adapterItem.getPosition(profile.getEdmORdelOF()));
org_type = (Spinner) findViewById(R.id.Updatesp_sign_up_manf_org_type);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
R.array.Org_type, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
org_type.setAdapter(adapter);
System.out.println(profile.getD_org_type()+"....getPosition..........."+adapter.getPosition(profile.getD_org_type()));
org_type.setSelection(adapter.getPosition(profile.getD_org_type()));
country = (Spinner) findViewById(R.id.Updatesp_sign_up_country);
ArrayAdapter<CharSequence> adapterCountry = ArrayAdapter.createFromResource(this,
R.array.Country, android.R.layout.simple_spinner_item);
adapterCountry.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
country.setAdapter(adapterCountry);
System.out.println(profile.getD_country()+"....getPosition..........."+adapterCountry.getPosition(profile.getD_country()));
country.setSelection(adapterCountry.getPosition(profile.getD_country()));
这里,我从bean对象配置文件中获取值并尝试将该值设置为spinner但是state没有获取值。对不起每一个人。我都改变了它