I\'m getting a view from the XML with the code below:
Button view = (Button) LayoutInflater.from(this).inflate(R.layout.section_button, null);
Yes, you can use for example in a button
Button b = new Button(this); b.setBackgroundResource(R.drawable.selector_test);