开发者

How to add ArrayList<My class> in ArrayAdapter for spinner?

开发者 https://www.devze.com 2023-03-12 08:49 出处:网络
private ArrayAdapter spn_1; ArrayList<My Class> result; spn_1 = new ArrayAdapter(this, android.R.layout.simple_spinner_item, result);
private ArrayAdapter spn_1;
ArrayList<My Class> result;
 spn_1 = new ArrayAdapter(this, android.R.layout.simple_spinner_item, result);

 spn_1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
            m_spn_gender.setAdapter(spn_1);

I try like this but it wrong

what should I d开发者_StackOverflowo?


You need to put objects in the ArrayList.

0

精彩评论

暂无评论...
验证码 换一张
取 消