There is a database from which the table with the text is taken and fills the list of RecyclerView through the adapter. In the activity where this data was filled in, the user can complete each element of the list (for example: date, name or gender). There is also a button with the help of which these augmented data should be saved in the new table. After that, this list can be viewed in the saved section.
How to save this list with data?
code example:
public class TasksTraining extends AppCompatActivity { private ImageView saveImageButton ; private DataBaseHelper databaseHelper; private Cursor cursor ; private RecyclerView rv ; private TasksTrainigAdapter adapter ; private ArrayList<Exersice> arrayList = new ArrayList<Exersice>() ; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tasks_trainning_layout); rv = findViewById(R.id.tasksTrainingRecyclerView); saveImageButton = findViewById(R.id.TasksTrainingSaveImageButton); LoadDatabase(); SQLiteDatabase db = databaseHelper.getWritableDatabase(); saveImageButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // ContentValues values = new ContentValues(); // values.put(TasksTrainingContract.TasksTrainigEntry.COLUMN_EXERCISE, ); // db.insert(TasksTrainingContract.TasksTrainigEntry.TABLE_NAME, null, values); } }); } public void LoadDatabase() { databaseHelper = new DataBaseHelper(getApplicationContext()); try { databaseHelper.checkAndCopyDatabase(); SQLiteDatabase db = databaseHelper.getReadableDatabase(); cursor = databaseHelper.getReadableDatabase().query("everyday", null, null, null, null, null, null); while (cursor.moveToNext()) { Exersice exersice = new Exersice(); exersice.setExercises(cursor.getString(1)); arrayList.add(exersice); } } finally { //cursor.close(); } LinearLayoutManager linearLayoutManager =new LinearLayoutManager(getApplicationContext()); adapter = new TasksTrainigAdapter(this,arrayList); rv.setLayoutManager(linearLayoutManager); rv.setAdapter(adapter); } }