android - List return null value -
i using code returns null value. when debug code show given null value
list<textjson> textlist = null; try{ textlist = new arraylist<textjson>(); cursor cursor = db.rawquery("select * "+table_texts + " " + key_cate + " = '" + text_spinner1 + " ' " , null); log.e("cursor is","==>"+cursor); log.e("0_0", "0_0 1=>"); // code working on here if(!cursor.islast()) { log.e("hey","last"); while (cursor.movetonext()) { textjson txtlist = new textjson(); txtlist.setid(cursor.getint(0)); txtlist.settext_status(cursor.getstring(1)); textlist.add(txtlist); } } db.close(); }catch (exception e){ log.e("error","is==> " +e); } return textlist; // null value
my log
e/spinner value is: --=> speech e/inside: getdetailtospinner e/cursor is: ==>android.database.sqlite.sqlitecursor@41b0f5d8 e/0_0: 0_0 1=> e/hey: last
help me out of this.
change
cursor cursor = db.rawquery("select * "+table_texts + " " + key_cate + " = '" + text_spinner1 + " ' " , null);
to
cursor cursor = db.rawquery("select * "+table_texts + " " + key_cate + " = '" + text_spinner1 + "'" , null); // or cursor cursor = db.rawquery("select * "+table_texts + " " + key_cate + " '" + text_spinner1 + "'" , null);
Comments
Post a Comment