Skip to content Skip to sidebar Skip to footer

How To Store Multiline Edittext Into Sqlitedatabase? [android]

I'm working on an application where I've 2 Multiline EditText and I need to store them into database. i only know how to store the single line EditText. Here is my codes for insert

Solution 1:

set a method on your dbHelper class and use a ContentValues, e.g :

public boolean createNote(String VALUE_1 , String VALUE_2) {
    ContentValues initValue = new ContentValues();
    initValue.put(COLUMN_NAME_1 , VALUE_1);
    initValue.put(COLUMN_NAME_2 , VALUE_2);

    return mDb.insert(YOUR_TABLE_NAME , null, initValue) > 0;
}

Post a Comment for "How To Store Multiline Edittext Into Sqlitedatabase? [android]"