开发者

set Model in Spinner

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜