Adding Custom Listview To Alert Dialog
I want to add custom list view too a alert dialog it works fine when i select a item from list and click the (setPositiveButton) the dialog close and the text is changed successful
Solution 1:
Please try these for setting list view inside alert dialog
AlertDialog.Builderalertdialog=newAlertDialog.Builder(context);
LayoutInflaterinflaterr= (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View viewtemplelayout= inflaterr.inflate(R.layout.product_popup, null);
YourAdapter adap=newYourAdapter(R.layout.product_add_popup_adapter,context);
list.setAdapter(adap);
alertdialog.setView(viewtemplelayout);
alertdialog.show()
i think it help full for you.
Post a Comment for "Adding Custom Listview To Alert Dialog"