-2

I am having a hard time figuring this one out. I am creating an Android app where the user (once logged in) sees an activity with a cardview list inside a recycler view.

I want the user to be able to click item on a card and go to a different activity. If you click menu item on card 1 you must go to the activity for game 1. If you click menu item on card 2 you must go to the activity for game 2. Etc...

Sudheesh R
  • 1,767
  • 3
  • 23
  • 43
  • 1
    It's unclear what you're asking. Please add some code snippets or an explanation of things you have already tried and be more specific about what you need. – Yep_It's_Me Jul 26 '17 at 06:36
  • Initially you will require a login activity to verify credentials..after that you need to add a recycler view and cardview inside it..After that you can set onclicklistner to the card and handle activity switching ..here are the links:1 For the cardview part https://www.androidhive.info/2016/05/android-working-with-card-view-and-recycler-view/ ..To add onclicklistner refer https://stackoverflow.com/questions/27081787/onclicklistener-for-cardview – Akshay Jul 26 '17 at 06:37
  • https://www.androidhive.info/2016/05/android-working-with-card-view-and-recycler-view/ here is the code and each cardview have one menu item( bottom right on every cardview) so i want each cardview menu item click open diff activity [ If you click on card 1menu you must go to the activity for game 1. If you click on card 2 menu you must go to the activity for game 2. ] cardview item name is "About" – neelam sai Jul 26 '17 at 06:51

1 Answers1

0

In your adapter's ViewHolder class add following:

 public ViewHolder(View itemView) {
        super(itemView);

        itemView.setOnClickListener(new View.OnClickListener(){
             // Start your activity


        });
    }

Create switch case to open different activities and then get recycler view position on the basis of that and provide different URL for each cards.

Aj 27
  • 2,316
  • 21
  • 29