vendredi 29 avril 2016

Android Sqlite - using integer in selection arguement

I have searched all SO questions but i don't think, this kind of question is asked. I have a database in which one of the column is of integer type(mobilenumber integer). I want to perform SELECT operation and using query(...) to perform the operation. In query(...), there is "selection args", I want to know how can I put Integer value in selection arguement where it takes string array for the arguements.

My query statement:

db.query(DataHandler.TABLE_CONTACTS, null, DataHandler.KEY_MOBILE + "= ?", new String[]{mobile}, null, null, null);

I am retrieving value of mobile number from edittext and the query is inside method.

ViewData(String mobile){
    db.query(DataHandler.TABLE_CONTACTS, null, DataHandler.KEY_MOBILE + "= ?", new String[]{mobile}, null, null, null);
    ....
}

Aucun commentaire:

Enregistrer un commentaire