0

What I want to do is to click on a CardView send me directly to the browser with a link already inserted as I can achieve that would greatly appreciate your help :).

Vicente NT
  • 21
  • 4

1 Answers1

0

Use the following code. Replace it with the id of your cardview in place of your_cardview_id

    CardView cardView;
    cardView = findViewById(R.id.your_cardview_id);

    cardView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
            startActivity(browserIntent);
        }
    });
Jarin Rocks
  • 975
  • 10
  • 17