Android Question Remove dynamically created view

Sreenadh OG

Member
Licensed User
Longtime User
Hi All,
I want to remove dynamically created views on Button_click event, I am adding two EditText and one button for each BtnAdd_Click(Edit texts for name and phone No., BtnRemove for remove these EditText ).
Now i want to delete corresponding EditTexts and Button on BtnRemove_Click. How can i perform this action on BtnRemove_Click..
removeView.JPG

My code is..
B4X:
'I am creating more than four Button for each edittext
'btnRmv.Initialize("btnRmv")
Sub btnRmv_Click
Dim n As Int
'this code didn't remove particular view
'here i want the index of btnRmv
SVNewCase.Panel.RemoveViewAt(i)
SVNewCase.Panel.RemoveViewAt(i-1)
SVNewCase.Panel.RemoveViewAt(i-2)
End Sub
 
Top