开发者

set Model in Spinner

开发者 https://www.devze.com 2023-02-23 12:12 出处:网络
How Set Model in Spinner in android like following array we can set. this.mAdapter = ArrayAdapter.createFromResource(this, R.array.Planets,

How Set Model in Spinner in android like following array we can set.

this.mAdapter = ArrayAdapter.createFromResource(this, R.array.Planets,
            android.R.layout.simple_spinner_dropdown_item);

But instead of R.array.Planets we want to set some Model or been it have开发者_C百科 id, country. so i can get id of selected country right now spinner provide me selected index.


You did not bother telling us what "some Model" is.

If "some Model" is a Cursor, use a CursorAdapter or SimpleCursorAdapter.

If "some Model" is something else, create your own subclass of BaseAdapter that will work with "some Model".

0

精彩评论

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