Untitled

 avatar
unknown
plain_text
3 years ago
940 B
7
Indexable
        SQLiteDatabase db = vtabani.getSqlLiteDatabase();
        String[] SELECT = {"_id", "_conjunction", "_gler", "_column", "_meaning", "_sentence"};
        String str_filt = "((";
        for (int i = 0; i < gler_filter.size(); i++)
        {
            str_filt += "_gler=" + gler_filter.get(i);
            if (i != gler_filter.size() - 1)
                str_filt += " or ";
        }
        str_filt += ") and (";
        for (int i = 0; i < ller_filter.size(); i++)
        {
            str_filt += "_ller=" + ller_filter.get(i);
            if (i != ller_filter.size() - 1)
                str_filt += " or ";
        }
        str_filt += ") and (_id NOT LIKE '" + question.id + "'))";
        //Log.e("1", "1str_filt: " + str_filt);
        Cursor cursor = db.query("(select random() as r, * from t_gler WHERE " + str_filt + ")", SELECT, null, null, null, null, "r LIMIT 1;");
        question.id = null;
Editor is loading...