2015-09-28 156 views

回答

1

试试以下,

File path=getFilesDir(); 
String mypath=path.toString() + "/myfolder"; 
OutputStreamWriter out; 
try { 
     File f = new File(mypath , "/myfile.txt" ); 
     out = new OutputStreamWriter(openFileOutput(f.getPath(),MODE_PRIVATE)); 
     out.write("test"); 
     out.close();     
    } 
0

您需要下列权限在您的应用程序

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />