title: How to check the CheckBox of ListView when item clicked?
body: <p>How to check the CheckBox of ListView when item clicked?</p>
  
  <p>I have a ListView with CheckBox, TextView, Button.</p>
  
  <p>Here i want to select multiple rows of ListView and so used CheckBox. If i click on a row, i want to make its corresponding CheckBox to be checked and get the RowID of the clicked item of ListView. </p>
  
  <p>If i click on Button, i want to open a pop-up or another Screen(Activity) but CheckBox must not be checked.</p>
  
  <p>How to do this? Please help.</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/sCGMM.png" alt="enter image description here"></p>
  
  <p>This is how my layout looks.</p>
  
  <p><strong>Code is simple using Adapter to the ListView.</strong></p>
  
  <pre><code>   public class Adapter extends BaseAdapter{
  
      private Context context;
      Button btnView;
      CheckBox box;       
      ArrayList&lt;String&gt; altextView1;
      ArrayList&lt;String&gt; altextView2;
  
  
      public Adapter(Context c, Button view, CheckBox checkBox, ArrayList&lt;String&gt; textView1, ArrayList&lt;String&gt; textView2) {
  
          this.context=c;
          this.btnView=view;
          this.box=checkBox;
          this.altextView1=textView1;
          this.altextView2=textView2;
      }
  
      @Override
      public int getCount() {
          // TODO Auto-generated method stub
          return altextView1.size();
      }
  
      @Override
      public Object getItem(int arg0) {
          // TODO Auto-generated method stub
          return null;
      }
  
      @Override
      public long getItemId(int arg0) {
          // TODO Auto-generated method stub
          return 0;
      }
  
      @Override
      public View getView(int arg0, View arg1, ViewGroup arg2) {
          // TODO Auto-generated method stub
  
          View view=arg1;
          view=LayoutInflater.from(context).inflate(R.layout.list7, null);
  
          TextView tv1=(TextView)view.findViewById(R.id.tV1);
          TextView tv2=(TextView)view.findViewById(R.id.tV2);
          btnView=(Button)findViewById(R.id.btnView);
          box=(CheckBox)findViewById(R.id.cB);
  
          tv1.setText(altextView1.get(arg0));
          tv2.setText(altextView2.get(arg0));
  
  
          return view;
      }
  
  }
  </code></pre>