title: GraphView not refreshing unless view is touched?
body: <p>I'm working with <a href="https://github.com/jjoe64/GraphView" rel="nofollow">jjoe64's GraphView project</a> but I am having issues when adding data on the fly. I'm trying to plot microphone volumes on a line graph but the graph refuses to update. Here's what I have:</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      LinearLayout layout = (LinearLayout) findViewById(R.id.GraphLayout);
  
      graph = new LineGraphView(this, "Sounds");
      data = new GraphViewSeries(new GraphView.GraphViewData[] { new GraphView.GraphViewData(X++, 0) });
      graph.addSeries(data);
      graph.setManualYAxis(true);
      graph.setManualYAxisBounds(32767, 0);
      graph.setViewPort(3, 100);
      graph.setScrollable(true);
      layout.addView(graph);
  
      final MediaRecorder media = new MediaRecorder();
      media.setAudioSource(MediaRecorder.AudioSource.MIC);
      media.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
      media.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
      media.setOutputFile("/dev/null");
      try {
          media.prepare();
      } catch (Throwable t) {}
      media.start();
  
      new Timer().scheduleAtFixedRate(new TimerTask() {
          @Override
          public void run() {
              final int amp = media.getMaxAmplitude();
              MaxSoFar = Math.max(amp, MaxSoFar);
              MainActivity.this.runOnUiThread(new Runnable() {
                  @Override
                  public void run() {
                      data.appendData(new GraphView.GraphViewData(X++, amp), true);
                      //Here I try few different things
                      TextView output = (TextView)findViewById(R.id.output);
                      String info = MaxSoFar + "" + nl;
                      info += amp + "";
                      output.setText(info);
                  }
              });
          }
      }, 0, 100);
  }
  </code></pre>
  
  <p>I've been doing a lot of experimenting on the line immediately after <code>data.appendData(...)</code> with things like <code>graph.redrawAll();</code>, <code>graph.invalidate();</code>, or <code>graph.postInvalidate();</code> but nothing. I can only get the graph to redraw if I put my finger down and drag the graph. Any sort of touch input will cause the graph to draw correctly. It might have something to do with it being in <code>runOnUiThread</code> but I can't think why that might be an issue and not a requirement.</p>
  
  <p>I'm debugging this on my Galaxy S3 running Cyanogenmod 10.1 Nightlies (Android 4.2.2).</p>