Can I apply Widget.AppCompat.Button to a button programmatically?
Button button = new Button(context);
button.setText("Button");
I am currently using a custom resource that is trying to implement a style, such as the AppCompat theme, but I think it might be easier.
In the layout, it implements as:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:theme="@style/ThemeBasedOnAppcompatButton"/>
Thanks in advance.
source
share