samedi 7 février 2015

How to get position in column from SQlite query?

IN SQLITE DATABASE



public String getAllNames() {
String selectQuery2 = "SELECT * FROM LIST ORDER BY nametype";
SQLiteDatabase database = this.getWritableDatabase();
Cursor cursor2 = database.rawQuery(selectQuery2, null);
if (cursor2.moveToFirst()) {
return cursor2.getString(15);//NAMES
}
database.close();
return cursor2.getString(15);//NAMES
}


IN NAME.JAVA



TextView menutype =(TextView)view.findViewById(R.id.menutype);
String m =controller.menuitems();


SO how do I get the position of the NAMES so I can set String m based on position 1, 2 or whatever


Aucun commentaire:

Enregistrer un commentaire