I am using SQLite
database to save my records, on returning them I am using this code:
mydb = new DBHelper(this);
ArrayList array_list = mydb.getAllItems();
ArrayAdapter arrayAdapter=new ArrayAdapter(this,android.R.layout.simple_list_item_1, array_list);
mRecyclerview =(RecyclerView) findViewById(R.id.items_List);
obj = (ListView)findViewById(R.id.listView1);
obj.setAdapter(arrayAdapter);
But this is showing me a normal list of items and I want to display a list with CheckBox
on every row. I tried using BaseAdapter
and also tried RecyclerView
but Its just not working. Is there a way to customize the simple_list_item_1?
you must write your own adapter and in getView() method, inflate your own view and pass data to it:
MyAdapter.java
And
my_item_layout
will be something like this:With this you just show check boxes....you can't save or change check boxes data
Have you tried CheckedTextview,You can