[Solved] How do i do setOnClickListener in Fragment


You can initialize a new onClickListener in for loop.

for(int i=0;i<sortableHeaderWrappers.length;i++)
    {
        sortableHeaderWrappers[i].setTag((Integer)i);
        sortableHeaderWrappers[i].setOnClickListener(new View.OnClickListener(){
 @Override
  public void onClick(View v) {
                //.. place your logic that needs to be executed when click happens. 
   }
})
    }

0

solved How do i do setOnClickListener in Fragment