0
String mimetype = ".docx\tapplication/vnd.openxmlformats-officedocument.wordprocessingml.document";
File file = new File(FilePath, filename);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file), mimetype);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
我使用上面的代碼來讀取.docx文件。
如何檢查應用程序是否可以支持文件格式?
如果沒有,下面的消息:如何檢查文檔文件是否可以在Android中支持
Toast.makeText(this, "Not be supported.", Toast.LENGTH_LONG).show();