How to open a new activity on itemclick in gridview.The below code not opening a new activity.Kindly help me -
// final arraylist<string> arr = new arraylist<string>(); arrayadapter<string> adapter = new arrayadapter<string>(this, android.r.layout.simple_list_item_1,r.id.textview1 ,prgmnamelist); gv = (gridview) findviewbyid(r.id.gridview1); textview1 = (textview) findviewbyid(r.id.textview1); gv.setadapter(new customadapter(this, prgmnamelist, prgmimages)); gv.setonitemclicklistener(new adapterview.onitemclicklistener() { public void onitemclick(adapterview<?> parent, view v, int position, long id) { intent intent = new intent(getapplicationcontext(),englishactivity.class); intent.putextra("id",v.getid()); intent.putextra("index",position); startactivity(intent); } }); }
Comments
Post a Comment