title: Android: Button states don't show when using layout inflater
body: <h2>Problem statement</h2>
  
  <p>I'm trying to implement my own virtual keyboard following example "softkeyboard", found in samples folder of android-sdk.</p>
  
  <p>In the onCreateInputView() view is created with layout inflater like this:</p>
  
  <pre><code>@Override
  public View onCreateInputView() {
      mContainerView = getLayoutInflater().inflate(R.layout.my_keyboard, null);
      return mContainerView;
  }
  </code></pre>
  
  <p>In my beautiful virtual keyboard gui definition (my_keyboard.xml) I have added some Buttons like this.</p>
  
  <pre><code>&lt;Button
      android:id="@+id/my_button1"
      android:onClick="onMyButton1Pressed"
      android:text="@string/my_button1_text" /&gt;
  </code></pre>
  
  <p>Now If I run the program, Button appears to be working: onMyButton1Pressed() gets called OK. The problem is that Button state drawings (orange highlight when pressed down) do not work. </p>
  
  <p><strong>EDIT 1:</strong> Issue is same with ToggleButton: when pressed down, orange highlight won't appear. However green "checked" mark works. If I use these in normal Activity, pressing down does give orange highlight when button is being pressed.</p>
  
  <h2>My findings so far, could be useful or not...</h2>
  
  <p>I have been trying to google, and read android documentation. Somewhere I read that using inflate with null root element, does not apply themes/styles/background-drawables/whatever (what is the correct term?) to inflated hierarchy. Is this the problem, why button states don't show?</p>
  
  <p>Now when I create virtual keyboard, what is the root element, where keyboard is added?</p>
  
  <p>Also I found an alternative inflate method:</p>
  
  <pre><code>public View inflate (int resource, ViewGroup root, boolean attachToRoot)
  
      resource = ID for an XML layout resource to load (e.g., R.layout.main_page)
      root = Optional view to be the parent of the generated hierarchy (if attachToRoot is true), or else simply an object that provides a set of LayoutParams values for root of the returned hierarchy (if attachToRoot is false.)
      attachToRoot = Whether the inflated hierarchy should be attached to the root parameter? If false, root is only used to create the correct subclass of LayoutParams for the root view in the XML.
  </code></pre>
  
  <p>Could I pass this some "dummy" viewgroup from which it can extract layout params?</p>