How to popup list like a spinner without spinner in android?

后端 未结 5 838
北海茫月
北海茫月 2021-02-06 11:51

I have a spinner widget in my activity which lets users pick a list name.

Normally, the function of the spinner is to switch between lists but for a couple of instances,

5条回答
  •  眼角桃花
    2021-02-06 12:28

    Use AlertDialog.Builder and supply an Adapter via setAdapter() that generates your rows.

    In your case, I would not use the same Cursor, as a Cursor has an intrinsic notion of the current row, and so messing with the Cursor while it is used by your SpinnerAdapter could screw up the Spinner. Go with an identical Cursor.

提交回复
热议问题