Possible Duplicate:
how to add button dynamically in android?
I need to create a button in android without using xml.I have tried the following code:
Button b=new Button(this);
b.setWidth(50);
However, It isn’t displaing in runtime.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to add the view to the layout before it will be shown on the screen.