Answer the question
In order to leave comments, you need to log in
How to create and set an adapter for AlertDialog?
Good afternoon. There is a layout that I want to show as a dialog. It has some elements like TextView, ImageView. How can I put data in these elements? I assume that you need to transfer the adapter there. So that's how to create it and how to pass it when creating a dialog?
val dialog = LayoutInflater.from(context).inflate(R.layout.news_dialog, null)
val builder = AlertDialog.Builder(context).setView(dialog)
builder.show()
Answer the question
In order to leave comments, you need to log in
It has some elements like TextView, ImageView
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question