In my current project I have a form that stores data in sqlite. I have 3 radio button inside one radio group. what I want to do is save the values of these radio buttons in one fragment and retrieve them in another in case user wanted to edit the form.
I already read this post but I couldn't solve the problem.
I found out I can't save boolean data in sqlite I should use Integer with 0 and 1 values. But I don't know how to implement it.
In my SQLiteOpenHelper class I made a new column like this:
public static final int COL5 = 0;
in my onCreate method i wrote
String createTable = "CREATE TABLE " + TABLE_NAME + " " +
"(ID INTEGER PRIMARY KEY AUTOINCREMENT, " +
COL2 + " TEXT, " + COL3 + " TEXT, " + COL4 + " TEXT, " + COL5 + " INTEGER DEFAULT 0)";
in my add addData method I added it as Integer
I don't know how should I save and retrieve it. How should I save whether or not the radio button is checked as an Integer and then retrieve the same value.