如何在android中打开excel文件

4 excel android

我已将excel文件下载到SD卡.想要在我的应用程序中打开该文件并进行处理.是否有任何方式或任何意图在Android中打开excel文件.一世

小智 9

使用下面提到的代码并尝试:

File file = new File(Environment.getExternalStorageDirectory()+ "/filepath/" + filename);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file),"application/vnd.ms-excel");
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)


San*_*ndy 0

你能详细说明一下吗?如果你想使用File从SD卡读取excel文件,这里是代码

File root = Environment.getExternalStorageDirectory();
File excelFile = new File(root, "filename.xlsx");
Run Code Online (Sandbox Code Playgroud)