我正在使用此方法在doc文件中编写内容。但是文件在创建文件后没有打开。它没有在手机中打开。请帮帮我。我是android的新手
public void wr(View v){
String sFileName="GradeSheet.docx";
String sBody=note;
try
{
File root = new File(Environment.getExternalStorageDirectory(), "NSUGT");
if (!root.exists()) {
root.mkdirs();
}
File gpxfile = new File(root, sFileName);
FileWriter writer = new FileWriter(gpxfile);
writer.append(sBody);
writer.flush();
writer.close();
Toast.makeText(this, "Saved in SD card", Toast.LENGTH_SHORT).show();
}
catch(IOException e)
{
e.printStackTrace();
}
}