After pondering Nicks answer I got it working:
plot = (XYPlot) findViewById(R.id.mySimpleXYPlot);
// nums is an array holding different numbers, where some are 0.
Number Nullnumber = null;
SimpleXYSeries series1test;
series1test = new SimpleXYSeries("title");
for (int j = 0; j < nums.length; j++){
if(nums[j]==0){
series1test.addLast(j, Nullnumber); // Does not display points for 0 values
//series1test.addLast(j, nums[j]); // Displays points for 0 values
} else {
series1test.addLast(j, nums[j]);
}
}
LineAndPointFormatter series1Format = new LineAndPointFormatter();
series1Format.setPointLabelFormatter(new PointLabelFormatter());
series1Format.configure(getApplicationContext(),
R.xml.line_point_formatter_with_plf1);
plot.addSeries(series1test, series1Format);