Custom button implementation with different states

I have created XML files (focus, enable, disable, press) using Statelist drawable for my custom button but I have few queries…

  1. How button code gets differed from Custom button in XML .
  2. I want to know whole procedure ( steps to write XML & Java code) for creating custom button with multiple background states .

Sorry, but this discussion category is for questions about the CommonsWare CWAC libraries. For general Android app development questions: