how to Display the particular field details in editext by giving id here i write code in database handler but i dont know what to do in MainActivity
My database Handler class
public Cursor getData(int id){
SQLiteDatabase db = this.getReadableDatabase();
Cursor res = db.rawQuery( "select * from student_details where ID="+id+"", null );
return res;
}
MAinActivity
public void show()
{
bshow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Cursor res=myDB.getData();//i got an error Here and i dont know what to do
}
});
}
Aucun commentaire:
Enregistrer un commentaire