why click event is not happening on table row?
Programmatically I am creating tablelayout and also adding rows to it. But when I clicked on table row its not getting clicked.
In every row I am adding textview and Imageview.I have set onclickListener to tablelayout.
TextView txt = (TextView) row.getChildAt(0);
String stTitle = txt.getText().toString();
int index = strTitle.indexOf(stTitle);
Log.d("AllFeat", " index "+index);
Log.d("AllFeat", " title "+stTitle);
int id = nId.get(index);
Intent i = new Intent(CatalogPage.this,AllFeats.class);
i.putExtra("id", id);
i.putExtra("title",stTitle);
startActivity(i);
The above c开发者_JAVA技巧ode I am writing in tablelayout.setOnclickListener.
First you can set rowId using setId(nt).After calling setcontentview(view) .findViewById and setOnclickListener();
精彩评论