I am having a TableLayout for which I added rows dynamically. In each of the row there are 2 elements of which one is TextView other is Button. When I click the button that is present in a row, that row should be deleted. How can this be done in Android ? How to find rowid and how to delete a row dynamically. Can anyone help me in sorting out this issue.
I am having a TableLayout for which I added rows dynamically. In each of
Share
onClick on the button will give you the clicked view, the button in your case. That button’s parent is the row you want to delete. Deleting that row from it’s parent will get rid of it.
An example of how you could implement this: