how to call activity based on clicked item in gridview

Hi All,

I am trying to call android activity on click of GridView item, I have 4 menu option in GridView so want to call activity based on clicked item.
gridView.ItemClick += delegate (object sender, AdapterView.ItemClickEventArgs args) {
// here I want to call next activity
};

Kindly suggest that how can I get item value and compare that to call activity.

Best Answers

Answers

  • Thanks Benjamin for answer
    Let me clarify what I want to do, I have created dashboard using GridView and having 4 menu options in that. Each menu has one Activity class and I am not able to call specific activity based on item clicked in GridView. GridView layout is having Image and Text View to show up menu.
    gridView.ItemClick += delegate (object sender, AdapterView.ItemClickEventArgs args) {
    Toast.MakeText(this, args.Position.ToString(), ToastLength.Short).Show(); // in this I am only getting item poistion
    StartActivity(typeof(CreateServiceRequest)); // here I am able to call single activity but no decision making call
    };

    So will I get only item position on GridView click and that only be the logic to next Activity?

    If I am not that much clear please let me know any option to connect back to you so I can make you understand complete scenario.

    Thanks,

  • thank you very much sir :)

Sign In or Register to comment.