tags:

views:

565

answers:

2

how to add button dynamically in android?

+3  A: 
        Button btn = new Button(this); 
        btn.setText("MyButton"); 
        layout.addView(btn);

Have a look to this example: http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/view/ScrollView2.html

nico
thnxs for ur help.Its working
deepthi
A: 

The link you have provided is not working.

Vipin
The working link is http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ScrollView2.html
Po