search cache table By Value - Android App

Android examples for App:Cache

Description

search cache table By Value

Demo Code


//package com.book2s;

import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

public class Main {
    static final String TABLE_NAME = "cache_data";
    static final String FIELD_SET_NAME = "set_name";
    static final String FIELD_VALUE = "value";

    public static Cursor searchByValue(SQLiteDatabase db, String key,
            String value) {/*from ww w . j  ava  2  s .c o  m*/
        return db.query(TABLE_NAME, null, FIELD_SET_NAME + "= ?,"
                + FIELD_VALUE + "=?", new String[] { key, value }, null,
                null, null);
    }
}

Related Tutorials