insert row wrapped in ContentValues to SQLiteDatabase - Android Database

Android examples for Database:ContentValues

Description

insert row wrapped in ContentValues to SQLiteDatabase

Demo Code


//package com.java2s;
import android.content.ContentValues;

import android.database.sqlite.SQLiteDatabase;

public class Main {
    public static long insert(SQLiteDatabase db, String name, String data) {
        ContentValues values = new ContentValues();
        values.put("data", data);
        return db.insert(name, null, values);
    }/*from   w  w w  .ja  v  a  2  s .  c om*/
}

Related Tutorials