'Android Studio - Clickable CardViews inside Fragement

I am new to Android Studio,

I have a "Settings Fragment" in which I have multiple CardViews (ID's: "account", "store", "bank", "Language", "User Interface", "support" etc.), however I don't know how to make it possible to click on them to open the respective activities "Account", "Store" etc.

The below code, successfully shows the various CardViews in the "Settings Fragment", however I can't figure out how to add onClickListeners. Can you help? Are there other possibilities?

Thanks alot in advance

package com.example.loginregister;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.Nullable;


public class SettingsFragment extends Fragment {

    @Nullable
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        return inflater.inflate(R.layout.fragment_settings, container, false);
    }
}


Solution 1:[1]

Is it the card view as a whole that should be clickable? Have you tried the following:

onClick(View v){

}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mebeingaprogrammer