Open Hessu007 opened 3 years ago
Hi @Hessu007,
unfortunately, you can't listen for cell clicks. All clicks are related to a table item/row.
But in case you always want to get the first column value of the clicked row, you can implement it like this:
public void onDataClicked(int rowIndex, String[] strings) {
final String contentOfFirstCell = strings[0];
Toast.makeText(MainActivity.this, contentOfFirstCell, Toast.LENGTH_SHORT).show();
}
Kind regards
what about - using strings[columnIndex]
? @Hessu007
Unfortunately this is not possible. The click listener does not respect the column, only the row.
I new with the TableView component. Is there some one who can show me, how to read. one single Cell value. If i am understand right public void onDataClicked - just return RowIndex int value - that fine - but not columnIndex. Or is there something like getSelectedCellValue() function or... how to implement
@Override public void onDataClicked(int rowIndex, String[] strings) {
Thanks for tips and support.