How to open an excel file in android

前端 未结 5 894
广开言路
广开言路 2021-01-06 08:25

I have downloaded the excel file to sdcard. want to open the file in my app and process it. Is there any way or any intent to open an excel file in android. I

5条回答
  •  长发绾君心
    2021-01-06 08:36

    Use the below mentioned code and try:

    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);
    

提交回复
热议问题