title: android custom keyboard paint some keys
body: <p>I am starting some tutorials in Android and I'm trying to make a custom keyboard.<br>
  It looks great but I would like to paint some keys. So I extend my class to <code>KeyboardView</code> and implement <code>onDraw()</code> function. When I debug my keyboard it never goes to my onDraw function. Here are some parts of my code.</p>
  
  <pre><code>public class CustomKeyboard extends KeyboardView {
  
      private KeyboardView mKeyboardView;
  
      public CustomKeyboard(Activity host,  AttributeSet attrs, int viewid, int layoutid) {
          super(host, attrs);
  
          mHostActivity= host;
          mKeyboardView= (KeyboardView)mHostActivity.findViewById(viewid);
          mKeyboardView.setKeyboard(new Keyboard(mHostActivity, layoutid));
          mKeyboardView.setPreviewEnabled(false);
          mKeyboardView.setOnKeyboardActionListener(mOnKeyboardActionListener);
          mHostActivity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
      }
  
      @Override
      public void onDraw(Canvas canvas) {
          super.onDraw(canvas);
  
          Paint paint = new Paint();
          paint.setTextAlign(Paint.Align.CENTER);
          paint.setTextSize(25);
          paint.setColor(Color.RED);
  
          List&amp;lt;Key&amp;gt; keys = getKeyboard().getKeys();
          for(Key key: keys) {
              if(key.label != null)
              canvas.drawText(key.label.toString(), key.x + (key.width/2), key.y + 25, paint);
          }
      }
  }
  </code></pre>