In my application generating dynamic text view. I want to add onclickListener to my text view. How can I do it please give me some hint. Here hard code for textview .
for (int i = 0; i < subCategory.length; i++) {
TextView tv = new TextView(this);
tv.setText(subCategory[i]);
tv.setId(i);
sCategoryLayout.addView(tv);
}
Create one View.onClickListener() object "mListener". Add this object to tv.setOnClickListener(mListener) in for loop.
Impelement OnClickListner on this class.
Yes I have also getting the same problem but friend I got the solution and it's worked for me
I have added Textview in run time and also get them click below is code.