When click on add phone text I want to add view dynamically (view below add phone: where 'mobile' is textview
and on right side there is edit text)
and this need to be for N level ..when user click on add phone view will be added..
How to do this.?
Try this code.This might help you.
In your Activity class on button Click just use the below method.And make sure to declare an int variable (index) that will help you add new View to the end.
So to get values from EditText use following code. There I have displayed the value in Toast, you can use an array of String to store all dynamically created EditText values.
Create XML as "custom_row.xml" with code:
Now make you activity layout as:
Now do code as:
Now you can access the Edit Text by following code: