RemoveAllViews() not removing TableRow children in a TableLayout?

After removing the row try setting the visibility to GONE and back to Visible again, This should fix the remove row glitch.

Up vote 0 down vote favorite share g+ share fb share tw.

Some background: I am having an issue with one part of my program where I am building a 'edit database' view and then removing the rows again. The fields which the 'edit database' view will show are different each time it is shown. The edit database view is a tablelayout, and each row in the database is a row in the table layout.

When the user exits the edit view, the view is supposed to be disposed or wiped of rows for the next time. My issue, is no matter what I try, I can't get the rows in the tablelayout to delete. Here are the relevent pieces of code: Get a handle on the tablelayout in the xml file setContentView(R.layout.

Database_entry); TableLayout editorLayout = (TableLayout)findViewById(R.id. DatabaseLayout); the layout is passed to another class, where they are added to the layout like this: //layout is the tablelayout from earler, passed into this function TableRow row = new TableRow(contex); row . SetLayoutParams(new LayoutParams(LayoutParams.

FILL_PARENT, LayoutParams. WRAP_CONTENT)); //stuff added to the row.... //... //... layout. AddView(row); When I attempt to wipe the Tablelayout, I run this code TableLayout editorLayout = (TableLayout)findViewById(R.id.

DatabaseLayout); editorLayout.removeAllViews(); Whatever I do, the next time I hit the button to edit the code, it will show the previous rows, as well as the new rows added. They are not removed from the table. I get no error messages or any useful debugging information, it just isn't functioning.

I have struggled with this for a while. Tried dynamically creating the tablelayout(no xml file), tried deleting each row (or just ONE row) with it's index. I have used the Hierarchy Viewer to check to make sure everything is a child of that tablelayout (it is).

If anyone has any insight, it would be much appreciated. Java android gui tablelayout tablerow link|improve this question asked 4 hours agoAncantus11.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions