private void createLineGraph(List<String[]> result){
DataPoint[] dataPoints = new DataPoint[result.size()];
for (int i = 1; i < 5; i++){
String [] rows = result.get(i);
Log.d(TAG, "Output " + (i+1) + " " + (i+2));
dataPoints[i] = new DataPoint(i+1, i+2);
}
LineGraphSeries<DataPoint> series = new LineGraphSeries<DataPoint>(dataPoints);
mGraph.addSeries(series);
}
Error:
java.lang.NullPointerException: Attempt to invoke interface method 'double com.jjoe64.graphview.series.DataPointInterface.getX()' on a null object reference
Error: java.lang.NullPointerException: Attempt to invoke interface method 'double com.jjoe64.graphview.series.DataPointInterface.getX()' on a null object reference