Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7937227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:28:18+00:00 2026-06-03T22:28:18+00:00

I use below code to open .doc file by call other application. But I

  • 0

I use below code to open .doc file by call other application.
But I don’t want the file be modify.
So I want to set file to read only.
Or any other method to avoid user modify file.
The file format may *.doc, *.docx, *.ppt, *.pptx, *.pdf, *.txt.

File file = new File(FilePath);
String mimetype = ".doc\tapplication/msword";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file), mimetype);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T22:28:20+00:00Added an answer on June 3, 2026 at 10:28 pm

    You cannot prevent data stored on the external storage from being changed by the user, provided they find an application willing to aid in this – readily available file manager apps for example.

    As long as the security model remains intact, data stored in the private storage area of an application can protected either from writing, or from both writing and reading by other applications.

    Some applications however are reluctant to attempt to access a file pointed to by an Intent if it is located in a different app’s private storage area, even if the file and directory permission bits have been set such that the Android system would allow them to. (For example, at least some versions of GMail refuse to attach a file that is not on the external storage, though they can be tricked into doing so provided the file is world readable.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using below code where i don't want to use JPEGEncodedImage.encode because it
I use below code for open image with NSOpenPanel but doesn't work //panel=NSOpenPanel NSString
i use the code below to open a new window when a user drops
I use below code to update listview. setListAdapter(MyAdapter); MyAdapter.notifyDataSetChanged(); getListView().setEmptyView(empty); But each time update,
When I use below code query database, I cannot get any result, but I
I use the code below to insert data into my sqlite-database but for some
I am using the below code to read .docx file and it is successfully
Using the below code I am unable to show the open/save as file dialog:
I want to write two program(.h and .cpp) with below code and use .h
I use a TabHost. The below code to call AActivity. intent = new Intent().setClass(this,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.