想要更改搜索而不是只有一个选项

时间:2016-08-16 19:05:14

标签: android

在下面的代码中,你只能获得一个项目,如果它等于它的COL_1,但如果我想要多个选项,如COL_2和COL_3,该怎么办?

public Cursor getItem(String item_name ,SQLiteDatabase sqLiteDatabase){
            String [] Projections = {COL_1,COL_2,COL_3,COL_4,COL_5};
            String selection = COL_1+" LIKE ?";
            String [] selection_args = {item_name};
            return sqLiteDatabase.query(Table_Name,Projections,selection,selection_args,null,null,null);
        }

0 个答案:

没有答案