android - The type of expression must be an array type but it resolved to string -
am developing application fetches info database..but shows error
private void add() { db = (new dbhelper(this)).getreadabledatabase(); string query = "select * stock product = ?"; string list_data; cursor c = db.rawquery(query, new string[] { list_data }); c.movetofirst(); final charsequence[] items = new charsequence[list_data.length()]; (int = 0; < list_data.length(); i++) { items[i] = list_data[i];//here error }
try
db = (new dbhelper(this)).getreadabledatabase(); string query = "select * stock product = ?"; string list_data; cursor c = db.rawquery(query, new string[] { list_data }); c.movetofirst(); final charsequence[] items = new charsequence[list_data.length()]; (int = 0; < list_data.length(); i++) { items[i] = list_data.charat(i); }
you can char string using charat(int index) method
android
No comments:
Post a Comment