我通过调用其它的应用程序,用下面的代码打开 .doc
文件
但是我不想把文件也改变了,所以我想把文件设置为只读模式。
或者其它的方法避免用户修改文件。
文件的格式可能是 *.doc, *.docx, *.ppt, *.pptx, *.pdf, *.txt。
File file = new File(FilePath);
String mimetype = ".doc\tapplication/msword";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file), mimetype);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);