Select last a row:
public void selectLastRow() {
if (tableDataView.getCount() > 0) {
int rowIndex = tableDataView.getCount() - 1;
AdapterView<?> parent = tableDataView;
View view = new LinearLayout(tableDataAdapter.getContext());
view.setLayoutParams(tableDataView.getLayoutParams());
InternalDataLongClickListener longClickListener = new InternalDataLongClickListener();
longClickListener.onItemLongClick(parent, view, rowIndex, rowIndex);
forceRefresh();
tableDataView.setSelection(rowIndex);
}
}
Add a new row:
bankDataAdapter.add(new Bank(bankLastID, ""));
bankDataAdapter.notifyDataSetChanged();
Focus on the the new row:
bankTableView.selectLastRow();
The result is not expected, lost the blink cursor on last row when selected:
https://drive.google.com/open?id=1beJ9QYTQu1Qe3iCqDKcRWcJ_-1IIZCAU
Expected result:
https://drive.google.com/open?id=1D2ncW-T7gO8rny_2IDZTeCyWI1hS7DSH
How to resolved my problems?
Thanks.
Select last a row:
Add a new row:
Focus on the the new row:
The result is not expected, lost the blink cursor on last row when selected:
https://drive.google.com/open?id=1beJ9QYTQu1Qe3iCqDKcRWcJ_-1IIZCAU
Expected result:
https://drive.google.com/open?id=1D2ncW-T7gO8rny_2IDZTeCyWI1hS7DSH
How to resolved my problems?
Thanks.