mercredi 27 avril 2016

SQlite Query to get Multiple value from same Column by passing CheckBox selected items

I have populated RecyclerView with CheckBox. When I click "APPLY" button ,I have gotten all the clicked check box value(CATEGORY). I need to get relevant data by passing this category in SQLite.

I have done it by selecting only one Category. But I need to get the relevant data of selected Category form the DataBase.

From the Image,

I need to get the relevant data of Bakery,Bowl,Box from the SQlite dataBase.

For getting only one selected item,I used the following Query:

public Cursor getProductDetail(String strCategoryID) {
    return db.query(DbHelper.MY_PRODUCT_TABLE, MY_PRODUCTLIST_FIELDS,
            DbHelper.JSON_CATEGORY_ID + "='" + strCategoryID+ "'", null, null,
            null, null);
}

enter image description here

How to do this? Please Help me.

Aucun commentaire:

Enregistrer un commentaire