title: Displaying realtime data in a textview element
body: <p>I am using graphview library in my android application to plot real time data coming from a sensor. I already have the graph, but I want to display the current value plotted in the graph also in a textview.</p>
  
  <p>Here is the code I used for plotting the data in the graphview. Here, as an example, I generate and simulate 100 random values. But it's the same principle. And those random values shall be displayed in the same time they are added (appendData()) in the graph.</p>
  
  <pre><code>  @Override
  protected void onResume() {
   super.onResume();
   // we're going to simulate real time with thread that append data to the graph
   new Thread(new Runnable() {
  
     @Override
     public void run() {
       // we add 100 new entries
       for (int i = 0; i &lt; 100; i++) {
         runOnUiThread(new Runnable() {
  
           @Override
           public void run() {
             addEntry();
           }
         });
  
         try {
           Thread.sleep(1000);
         } catch (InterruptedException e) {
         }
       }
     }
    }).start();
   }
  
  private void addEntry() {
    series.appendData(new DataPoint(lastX++, RANDOM.nextDouble() * 100d),    true, 100);     
   }
  </code></pre>
  
  <p>Or is there another way than using a textview element?</p>
  
  <p>Thanks in Advance!</p>