0

I was trying to use this code, but nothing happened.

    String content = "hello";
    File file;
    FileOutputStream oustrong texttputStream;
    try {
        file = new File(Environment.getExternalStorageDirectory(),"MyCache.txt");
        outputStream = new FileOutputStream(file);
        outputStream.write(content.getBytes());
        outputStream.close();
        Toast.makeText(this,"Successss ...", Toast.LENGTH_SHORT).show();
    } 
    catch (IOException e) {
        e.printStackTrace();
    }

0 Answers0