FWQ
安卓打开 Word 文档时出错,如何解决启动 Activity 失败问题?
安卓打开 word 文档时出错 问题描述 执行 startactivity(intent); 后,程序自动关闭。文件路径为 “/storage/emulated/0/检测报告/20240919151923_检测记录.docx”。 解决方案 1. 检查文件路径的权限 确保应用拥有读取外部存储的权限。 在 androidmanifest.xml 中添加权限 。 在代码中请求权限 activitycompat.requestpermissions()。 2. 构建用于打开 word 文件的 intent 确保 intent 正确构建: public intent…