I am trying to create a universal image selector for multiple buttons. Is there an option to change the xml\'s \"android:drawable\" resource from java code?
You can set button drawable from java like
btnSettings.setBackgroundResource(R.drawable.ic_launcher);