sqlite - Android Auto Complete Text View -


good day! working auto complete text view in android. idea 2 columns sqlite (in case pid, pname , size) , given constraints data database shown (pid, pname, , size). whenever test it, pname shows.

public cursor getmatchingproduct(string constraint) throws sqlexception {

    string querystring =             "select _pid `_id`, pname, size " + dbase.table1;      if (constraint != null) {         constraint = constraint.trim() + "%";         querystring += " pname ?";     }     string params[] = { constraint };      if (constraint == null) {         params = null;     }     try {         db = dbhelper.getwritabledatabase();         cursor cursor = db.rawquery(querystring, params);         if (cursor != null) {             ((activity) this.context).startmanagingcursor(cursor);             cursor.movetofirst();             return cursor;         }     }     catch (sqlexception e) {          throw e;     }     db.close();     return null; } 

any highly appreciated.

i expect querystring

string querystring = "select _pid, pname, size " + dbase.table1; 

unless table name pid , not _pid, be

 string querystring = "select pid, pname, size " + dbase.table1; 

Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -