Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid AChartEngine Chart Bitmap NullPointerException
    primarykey
    data
    text
    <p>I know this question was asked earlier once but I see no answer to it from back then. Hence if you someone can guide me in this regard, I would grateful.</p> <p><a href="https://stackoverflow.com/questions/7188556/android-need-help-with-diagram">Android need help with diagram</a></p> <p>I have an error in the below part:</p> <pre><code> double x = 0; double y = 0; for (int i=0;i&lt;10;i++) { x=x+10; y=y+5; mCurrentSeries.add(x, y); } Log.i("Series Count",""+mCurrentSeries.getItemCount()); for (int xy=0;xy&lt;10;xy++) { Log.i("Series -- Values","["+mCurrentSeries.getX(xy)+","+mCurrentSeries.getY(xy)+"]"); } if (mChartView != null) { mChartView.repaint(); } Bitmap bitmap = mChartView.toBitmap(); try { File file = new File(Environment.getExternalStorageDirectory(), "test" + index++ + ".png"); OutputStream output = new FileOutputStream(file); bitmap.compress(CompressFormat.PNG, 100, output); output.flush(); output.close(); } catch (Exception e) { Toast.makeText(LineChartTestActivity.this, "Graph Exception", Toast.LENGTH_LONG).show();//Added Toast to see exception on device Log.e("ERROR", "BITMAP EXCEPTION"); e.printStackTrace(); } </code></pre> <p>To be specific the below line gives me a java.lang.NullPointerException</p> <pre><code>bitmap.compress(CompressFormat.PNG, 100, output); </code></pre> <p>Like Handy mentioned in his question, I'm also able to make it work using the editText but for some odd reason it will not work when I give explicit values from the code!</p> <p>Please advise.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload