w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to add text field with button when click on Add(+) button, again click new added button add one more fields in android?

You have add like the following code,

Button myButton = new Button(this);
myButton.setText("New");    
LinearLayout ll = (LinearLayout)findViewById(R.id.myLayout);
LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
ll.addView(myButton, lp);




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.