Skip to content Skip to sidebar Skip to footer

How To Get Tablerow Value Using Table Layout?

I am beginner to learn android,I have assigned table row value by dynamically. But I am not able to get the row value using on click listener method . Can any one please help to so

Solution 1:

You have to set the onClickListener on the row not the layout.

Solution 2:

I think this is what u need...try this and modify as u wish...

//...
tr.setOnClickListener(newView.OnClickListener() {
publicvoidonClick(View view) {
  TableRowt= (TableRow) view;
  TextViewfirstTextView= (TextView) t.getChildAt(0);
  TextViewsecondTextView= (TextView) t.getChildAt(1);
  StringfirstText= firstTextView.getText().toString();
  StringsecondText= secondTextView.getText().toString();
}
});
//...

Post a Comment for "How To Get Tablerow Value Using Table Layout?"