android - Gridview: Detail page having different screens -


in gridview when selecting each item going same same page. need go different pages according icon name

here java class

rowview.setonclicklistener(new onclicklistener() {              @override             public void onclick(view v) {                 intent intent = new intent(context, secondactivity.class);                 //add position intent used in second activity.                 intent.putextra("position", position);                 context.startactivity(intent);             }         }); 

what changes should make ?

instead of onclicklistener,you have try onitemclicklistener. find position of listview item. code:-

rowview.setonitemclicklistener(new onitemclicklistener() {              @override             public void onitemclick(adapterview arg0, view arg1, int position,                     long arg3) {                 intent intent = new intent(context, secondactivity.class);                 //add position intent used in second activity.                 intent.putextra("position", position);                 context.startactivity(intent);             }         }); 

i hope you.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -