How to programmatically create/initialise a Button with a custom style?
问题 I am trying to programmatically create some Buttons to add them to an existing ViewGroup. This works fine, but I am not able to init the buttons with the right style. I am aware, that it is not possible to set/change the style of view once it has been created. But all solutions I found so far say, that it should be no problem to create a view with a custom style (from a API level 11 up I think and I am using 14+): Button button = new Button (getActivity(), null, R.style.MyButtonStyle); The