Place your styling in a default.css
file under your assets (any other file name will not load). After that, you are pretty much set without calling the setStyle
(you don't need that in that context).
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Pixate.init(this);
setContentView(R.layout.activity_main);
// No need to get a hold of the button. Pixate init will capture it.
// Just make sure you have set the id in the XML layout to "button1"
// Button b = (Button) findViewById(R.id.button1);
}
[ADDITION] Also note the comment above and check out the blog post at http://www.pixate.com/blog/2013-10-30-android-button-demo/ to see how to style the button's states. Pixate is an open-source project, so you can grab the library from https://github.com/Pixate/pixate-freestyle-android (it contains a couple of sample projects to help you get started)