-
i want to search data by name as well from my sqlite database and want to show some suggestion during search thanks in advance my source code
Right now i am searching data by integer just tell me one thing by which i can replace Integer.parseInt and long to get search by name.and code for showing the suggestion while search using edittext field.`` Search.java { Cursor c = db.getContact(Integer.parseInt (et2.getText().toString())); if (c.moveToFirst())
DisplayContact(c); else Toast.makeText(getBaseContext(), "No Data Found, Please Register First", Toast.LENGTH_LONG).show();DBAdapter.java public Cursor getContact(long aname) throws SQLException {
Cursor mCursor =db.query(true, DATABASE_TABLE, new String[] {KEY_ROWID, COLUMN_NAME, COLUMN_AGE, COLUMN_OCCUPATION, COLUMN_DATE, COLUMN_ADDRESS,enter code here
COLUMN_PHONE, COLUMN_BIRTH, COLUMN_SEX, COLUMN_BILL}, COLUMN_BILL + "=" + aname, null, null, null, null, null); if (mCursor != null) { mCursor.moveToFirst(); } return mCursor; }`
vendredi 26 juin 2015
enable search filter while searching data from sqlite android
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire