KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am using a Button created using following code LinearLayout ll = new LinearLayout(this); ll.setOrientation(LinearLayout.VERTICAL); Button btn = new Button(this); btn.setOnClickListener(newtodobtn); btn.setText("New Todo"); btn.setBackgroundDrawable(new Button(this).getBackground()); ll.addView(btn); I have an image in path @drawable/new_todo_image to set as background for the button. How to set it to the Button programmatically?
Tags (comma-separated)
Save Edits
Cancel