title: onDraw not called in custom view
body: <p>I want to use my custom view in a LinearLayout, but onDraw() is never called. 
  I've read several posts but didn't found a solution which describes updating view from a service.</p>
  
  <p>my service controls a mediaplayer with attached visualizer. Androids visualizer reports updates in byte array to a custom View where I'm calling invalidate() and I expect onDraw() gets called, but that never happens.</p>
  
  <p>I'm using Fragment to start media player service and get instance of my custom visual view and doing updates this way:</p>
  
  <p>MediaPlayer Service:</p>
  
  <pre><code> LayoutInflater layoutInflater = (LayoutInflater)
                  getSystemService(LAYOUT_INFLATER_SERVICE);
   View layout = layoutInflater.inflate(R.layout.player, null);
   this.visualizerView = (VisualizerView) layout.findViewById(R.id.visualizerView);
  
                                     ...
  
   this.visualizer.setDataCaptureListener(new Visualizer.OnDataCaptureListener() {
   public void onWaveFormDataCapture(Visualizer visualizer, byte[] bytes,
                                                        int samplingRate) {
                          visualizerView.updateVisualizer(bytes);
   }
  
   public void onFftDataCapture(Visualizer visualizer, byte[] bytes, int samplingRate) {
                      }
    }, Visualizer.getMaxCaptureRate() / 2, true, false);
  </code></pre>
  
  <p>Custom View class:</p>
  
  <pre><code>public VisualizerView(Context context, AttributeSet attrs) {
          super(context, attrs);
          init();
      }
  
      public void setValues(float[] values){
  
      }
  
      private void init() {
          this.setWillNotDraw(false);
          mBytes = null;
      }
  
      public void updateVisualizer(byte[] bytes) {
          mBytes = bytes;
          invalidate();
      }
  
      @Override
      protected void onDraw(Canvas canvas) {
          super.onDraw(canvas);
          ...
      }
  </code></pre>