android - How to call the Gridview Activity from another activity -
i need idea on how call activity has gridview activity. basically, supposed main activity has 1 button , when click button directed activity following sample code
public void onclick(view v){ if (v.getid() == r.id.button2) { intent intent = new intent(this, anotheractivity.class); this.startactivity(intent); } }
but if activity i'm being redirected contains gridview layout, how call when press button? don't have time write code here. best if give me idea or make sample code in advance.
your code should work on activity have regardless of layout have. replace intent intent = new intent(this, anotheractivity.class);
intent intent = new intent(this, activitywithgridview.class);
remeber cannot see gridview if not populated data.
Comments
Post a Comment