title: linear layout click not working, what am i doing wrong?
body: <p>i have a view that i want to set it clickable to open a new activity. the code runs without any errors but when i click on a list in the main activity, nothing happens. the list displays alright but when a particular data is clicked, nothing at all happens. this is the code for the adapter</p>
  
  <pre><code>package com.example.helpresponse;
  
  import android.content.Context;
  import android.content.Intent;
  import android.support.annotation.NonNull;
  import android.support.v7.widget.RecyclerView;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.LinearLayout;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import java.util.ArrayList;
  import java.util.Locale;
  
  public class TargetDataAdapter extends RecyclerView.Adapter&lt;TargetDataAdapter.TargetViewHolder&gt;{
  
      ArrayList&lt;AndroidTargets&gt; targetsArrayList;
      private Context context;
      private HandleClick mHandleClick;
  
  
      public TargetDataAdapter(ArrayList&lt;AndroidTargets&gt; mTargetData) {
          targetsArrayList = mTargetData;
      }
  
      public void setmHandleClick(HandleClick handleClick) {
          this.mHandleClick = handleClick;
      }
      @NonNull
      @Override
      public TargetViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
          context = viewGroup.getContext();
          View v= LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.target_row,viewGroup,false);
          return new TargetViewHolder(v);
      }
  
      @Override
      public void onBindViewHolder(@NonNull TargetViewHolder viewHolder, int i) {
          viewHolder.androidTargetName.setText(targetsArrayList.get(i).FIELD1 );
          viewHolder.androidTargetNumber.setText(String.format(Locale.getDefault(), "API Level: %d", targetsArrayList.get(i).FIELD2));
          viewHolder.androidTargetShortName.setText(targetsArrayList.get(i).FIELD3);
          viewHolder.myClickableView.setClickable(true);
  
  
  /*
          viewHolder.myClickableView.setOnClickListener((v) -&gt; {
              Intent intent = new Intent(context, MapsActivity.class);
              //int myData = 1;
              //intent.putExtra("myDataKey", myData);
              //more intent.putExtra(s) as needed
              context.startActivity(intent);
          });
  
  */
  
  
          viewHolder.myClickableView.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  // Do your stuff
  
                  Intent intent = new Intent(context, MapsActivity.class);
                  int myData = 1;
                  intent.putExtra("myDataKey", myData);
                  //more intent.putExtra(s) as needed
                  context.startActivity(intent);
              }
          });
  
      }
      @Override
      public int getItemCount() {
          if(targetsArrayList == null)
              return 0;
          return targetsArrayList.size();
      }
  
      public class TargetViewHolder extends RecyclerView.ViewHolder {
          protected TextView androidTargetName;
          protected TextView androidTargetNumber;
          protected TextView androidTargetShortName;
          protected LinearLayout myClickableView;
  
  
          public TargetViewHolder(@NonNull View itemView) {
  
              super(itemView);
              myClickableView =  itemView.findViewById(R.id.linearLayout);
              androidTargetShortName = itemView.findViewById(R.id.textView2);
              androidTargetName = itemView.findViewById(R.id.textView3);
              androidTargetNumber = itemView.findViewById(R.id.textView4);
  
          }
      }
  
      public interface HandleClick {
  
          void onItemClick(int index);
  
      }
  
  
  }
  
  </code></pre>
  
  <p>this code is the main activity</p>
  
  <pre><code>package com.example.helpresponse;
  
  import android.app.ProgressDialog;
  import android.content.Intent;
  import android.os.Bundle;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.LinearLayoutManager;
  import android.support.v7.widget.RecyclerView;
  import android.util.Log;
  import android.view.View;
  import android.widget.AdapterView;
  
  import com.google.firebase.database.DataSnapshot;
  import com.google.firebase.database.DatabaseError;
  import com.google.firebase.database.DatabaseReference;
  import com.google.firebase.database.FirebaseDatabase;
  import com.google.firebase.database.ValueEventListener;
  
  import java.util.ArrayList;
  import java.util.List;
  
  public class ShowStudentDetailsActivity extends AppCompatActivity {
  
  
      DatabaseReference databaseReference;
  
      ProgressDialog progressDialog;
  
      List&lt;StudentDetails&gt; list = new ArrayList&lt;&gt;();
  
      RecyclerView recyclerView;
  
      RecyclerView.Adapter adapter ;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_show_student_details);
  
  
  
          recyclerView = findViewById(R.id.recyclerView);
  
          recyclerView.setHasFixedSize(true);
  
          recyclerView.setLayoutManager(new LinearLayoutManager(ShowStudentDetailsActivity.this));
  
          progressDialog = new ProgressDialog(ShowStudentDetailsActivity.this);
  
          progressDialog.setMessage("Loading Data from Firebase Database");
  
          progressDialog.show();
  
          databaseReference = FirebaseDatabase.getInstance().getReference("Police").child("Chats");
  
          databaseReference.addValueEventListener(new ValueEventListener() {
              @Override
              public void onDataChange(DataSnapshot snapshot) {
  
                  for (DataSnapshot dataSnapshot : snapshot.getChildren()) {
  
                      StudentDetails studentDetails = dataSnapshot.getValue(StudentDetails.class);
  
                      list.add(studentDetails);
                  }
  
                  adapter = new RecyclerViewAdapter(ShowStudentDetailsActivity.this, list);
  
  
                  recyclerView.setAdapter(adapter);
  
                  progressDialog.dismiss();
              }
  
              @Override
              public void onCancelled(DatabaseError databaseError) {
  
                  progressDialog.dismiss();
  
              }
          });
  
  
      }
  }
  </code></pre>
  
  <p>this code is the layout.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:clickable="true"
      &gt;
  
      &lt;TextView
          android:id="@+id/textView2"
          android:textColor="@color/colorPrimary"
          style="@style/Base.TextAppearance.AppCompat.Small"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginStart="8dp"
          android:layout_marginTop="8dp"
          android:layout_marginBottom="8dp"
          android:gravity="center"
          android:text="textview"
          android:minWidth="100dp"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          android:clickable="true"/&gt;
  
      &lt;LinearLayout
          android:id="@+id/linearLayout"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_marginStart="8dp"
          android:layout_marginTop="8dp"
          android:layout_marginEnd="8dp"
          android:layout_marginBottom="8dp"
          android:orientation="vertical"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toEndOf="@+id/textView2"
          app:layout_constraintTop_toTopOf="parent"
          android:clickable="true"
          &gt;
  
          &lt;TextView
              android:id="@+id/textView3"
              android:gravity="center_vertical"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:textStyle="bold"
              android:layout_marginBottom="8dp"
              android:text="textview"
              android:clickable="true"/&gt;
  
  
  
          &lt;TextView
              android:layout_marginTop="8dp"
              android:id="@+id/textView4"
              android:gravity="center_vertical"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:text="textview"
              android:clickable="true"/&gt;
      &lt;/LinearLayout&gt;
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p>please help, thank you</p>