title: How to call method to plot Graph Android
body: <p>I've been trying to plot a graph from two ArrayLists on my Android Application. I got the values from ArrayList succeed, but I can't call method to get values. </p>
  
  <p>I create this method which gets values from my database:</p>
  
  <pre><code>public DataPoint[] setData(String data)
  {
      TextView editText4;
      editText4 = (TextView) findViewById(R.id.editText4);
      String[] lucas = data.split(",");
  
      List&lt;String&gt; ok = new ArrayList&lt;String&gt;(Arrays.asList(lucas));
      List&lt;String&gt; yes = new ArrayList&lt;String&gt;(Arrays.asList(lucas));
  
      int n = ok.size();     //to find out the no. of data-points
      editText4.setText(String.valueOf(n));
      DataPoint[] values = new DataPoint[n];     //creating an object of type DataPoint[] of size 'n'
      for (int i = 0; i &lt; n; i++)
       {
          DataPoint v = new DataPoint(Double.parseDouble(ok.get(i)), Double.parseDouble(yes.get(i)));
          values[i] = v;
       }
       return values;
   }
  </code></pre>
  
  <p>My problem is here in setData (Cannot Resolve symbol 'setData') :</p>
  
  <pre><code>GraphView graph;
  PointsGraphSeries&lt;DataPoint&gt; series;       //an Object of the PointsGraphSeries for plotting scatter graphs
  graph = (GraphView) findViewById(R.id.graph);
  series = new PointsGraphSeries&lt;&gt;(setData);   //initializing/defining series to get the data from the method 'data()'
  graph.addSeries(series);                   //adding the series to the GraphView
  series.setShape(PointsGraphSeries.Shape.POINT);
  series.setSize(6);
  </code></pre>