Search code examples
androidandroid-recyclerviewandroid-listviewandroid-gridview

What is the most simple way to make a user selectable list of Strings in Android?


I am working with API Level 23.

Lets say I have a List<String> which I want to present to the user, so that he can make a multiple selection and then press an OK button. Now I would like to know which items were selected and continue to work with them. I do not care how it looks.

I assumed this would be very simple to do.

I have read about ListView, ListActivity, GridView, RecyclerView, Adapters, Layout Inflation and Selector Drawables.

Now I am confused and decided to ask for help here. It seems that things have changed over time and that some approaches would not be considered to be suitable anymore.

Considering the changes in Android development, what is the most simple way to do it today?


Solution

  • RecyclerView with a custom Adapter is the best option.