android-如何让文档实现只读的功能?

问题描述

如何让文档实现只读的功能?

我通过调用其它的应用程序,用下面的代码打开 .doc 文件
但是我不想把文件也改变了,所以我想把文件设置为只读模式。
或者其它的方法避免用户修改文件。
文件的格式可能是 *.doc, *.docx, *.ppt, *.pptx, *.pdf, *.txt。

File file = new File(FilePath);
String mimetype = ".doctapplication/msword";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file), mimetype);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
时间: 2024-09-20 01:10:40

android-如何让文档实现只读的功能?的相关文章

Android官方入门文档[2]运行你的应用程序

Android官方入门文档[2]运行你的应用程序   Running Your App运行你的应用程序   This lesson teaches you to1.Run on a Real Device2.Run on the Emulator You should also read•Using Hardware Devices•Managing AVDs with AVD Manager•Managing Projects 这节课教你1.运行在真实设备2.运行在模拟器 你也应该阅读•使用硬

Android官方入门文档[4]启动另一个Activity

Android官方入门文档[4]启动另一个Activity   Starting Another Activity启动另一个Activity This lesson teaches you to1.Respond to the Send Button2.Build an Intent 3.Create the Second Activity4.Receive the Intent5.Display the Message You should also read•Installing the S

Android官方入门文档[7]样式化操作栏

Android官方入门文档[7]样式化操作栏   Styling the Action Bar样式化操作栏   This lesson teaches you to1.Use an Android Theme2.Customize the Background3.Customize the Text Color4.Customize the Tab Indicator You should also read•Styles and Themes•Android Action Bar Style

Android官方入门文档[16]创建一个Fragment代码片段

Android官方入门文档[16]创建一个Fragment代码片段   Creating a Fragment创建一个Fragment代码片段   This lesson teaches you to1.Create a Fragment Class2.Add a Fragment to an Activity using XML You should also read•Fragments 这节课教你1.创建一个Fragment代码片段类2.使用XML来添加一个Fragment代码片段给一个活

Android官方入门文档[9]支持不同的语言

Android官方入门文档[9]支持不同的语言 Supporting Different Languages支持不同的语言   This class teaches you to1.Create Locale Directories and String Files2.Use the String Resources You should also read•Localization Checklist•Localization with Resources 该课程教你1.创建区域设置目录和文件

Android官方入门文档[10]支持不同的屏幕

Android官方入门文档[10]支持不同的屏幕   Supporting Different Screens支持不同的屏幕   This lesson teaches you to1.Create Different Layouts2.Create Different Bitmaps You should also read•Designing for Multiple Screens•Providing Resources•Iconography design guide 这节课教你1.创建

Android官方入门文档[14]停止和重新启动一个Activity活动

Android官方入门文档[14]停止和重新启动一个Activity活动 Stopping and Restarting an Activity停止和重新启动一个Activity活动   This lesson teaches you to1.Stop Your Activity2.Start/Restart Your Activity You should also read•Activities 这节课教你1.停止您的Activity活动2.启动/重新启动您的Activity活动 你也应该阅

Android官方入门文档[18]与其他碎片通信

Android官方入门文档[18]与其他碎片通信 Communicating with Other Fragments与其他碎片通信   This lesson teaches you to1.Define an Interface2.Implement the Interface3.Deliver a Message to a Fragment You should also read•Fragments 这节课教你1.定义一个接口2.实现接口3.传递一个消息给一个代码片段 你也应该阅读•片段

Android官方入门文档[1]创建一个Android项目

Android官方入门文档[1]创建一个Android项目   创建一个Android项目   这节课教你1.创建与Android Studio中的一个项目2.创建使用命令行工具项目 你也应该阅读•管理项目 Creating an Android Project This lesson teaches you to1.Create a Project with Android Studio2.Create a Project with Command Line Tools You should