Code here
final int c = 12; final TextView[] mtext = new TextView[c]; for (int i = 0; i < c; i++) { TextView rowtxt = new TextView(this); rowtxt.setText("Hello" + i); myLinearLayout.addView(rowtxt); myTextViews[i] = rowtxt; myTextViews[i].setOnClickListener(onclicklistener);
}
OnClickListeners code here
OnClickListener onclicklistener = new OnClickListener() { @Override public void onClick(View v) {
};
Hope this is helpful for you.
sunder sharma
source share