android - How to make spinner in dialog mode? -
i have button in application , when click on button, opens spinner, spinner in dropdown mode , need make in dialog mode. api 11 , higher, there simple code trick:
spinner s1 = new spinner(this, spinner.mode_dialog);
but need use code api 7 , higher. me, please?
this how did:
here, questions string[];
dialoginterface.onclicklistener questiondialoglistener = new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface arg0, int arg1) { // implement coding getting selected item. arg0.dismiss(); } }; alertdialog.builder builder = new alertdialog.builder(this); builder.settitle("select question:"); builder.setitems(questions, questiondialoglistener); alertdialog dialog = builder.create(); dialog.show(); }
Comments
Post a Comment