android - Gridview image to give sqlite data -
i have been trying find can me retrieve sqlite database row when click on gridview image ! when click first image on new activity shows me data related image saved in database.
@override public void onclick(view v) { // todo auto-generated method stub intent intent = new intent(mcontext,herodata.class); intent.putextra("imageid", mthumbids[position]); mcontext.startactivity(intent); }
this how i'm starting new activity , putting image click, need know how sql database row has data related image.
public cursor gettestdata() { try { string sql ="select * heroes"; cursor mcur = mdb.rawquery(sql, null); if (mcur!=null) { mcur.movetonext(); } return mcur; } catch (sqlexception msqlexception) { log.e(tag, "gettestdata >>"+ msqlexception.tostring()); throw msqlexception; } }
the above cursor data, want 1 row.
you can pass image position next activity... , after pass image position select query related data of image displayed...
so try this:
string sqlstring ="select * heroes id = "+position;
Comments
Post a Comment