0

I am creating a graph app with MP android chart library by PhilJay. I put a button which is meant to save the chart to my Gallery but its not saving on my Sony xperia Z2(Api 23 ). It saved on my leapdroid emulator and an injoo test phone . Please what could be the problem.

I also added the permission needed to the manifest.xml file

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>.
`
savebutton.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                            linechart.saveToGallery("new Line chart", 85);
                        linechart.setSaveEnabled(true);
                            Toast.makeText(getApplicationContext(), "graph saved ", Toast.LENGTH_LONG).show();
                    }
            });`
ade
  • 21
  • 2
  • 3
  • For Android Marshmallow and above it is not enough to put the permission in the manifest. You must request it at runtime. See [this answer](http://stackoverflow.com/a/34722591/5241933) – David Rawson Dec 22 '16 at 08:36
  • ok i will try that – ade Jan 06 '17 at 12:03
  • Possible duplicate of [Android marshmallow request permission?](http://stackoverflow.com/questions/33666071/android-marshmallow-request-permission) – David Rawson Jan 22 '17 at 05:24

0 Answers0