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 9249331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:09:45+00:00 2026-06-18T10:09:45+00:00

I had one issue with file editing in android using implicit intents, it got

  • 0

I had one issue with file editing in android using implicit intents, it got solved know, It took lot of time and permutations and combinations to solve it, but still finally I am left with doubt, The problem got solved but my quest to know why the problem got solved is not solved.

Please let me know if in case u have any clue on this.

Coming to my problem.

  1. I have an activity. I have a Button in the activity. I want to open a pre existing log file (which is a text file example log.txt) stored in the location “/mnt/sdcard/xxx/log.txt”

  2. The below is the implicit intent code i wrote and i ended up with an exception ” No activity found”

code1: which i tried and got exception

Uri uri = Uri.parse("file:///sdcard/xxx/log.txt");
Intent viewTestLogFileIntent = new Intent(Intent.ACTION_EDIT,uri);
viewTestLogFileIntent.setType("text/plain");

code2: which i tried and got exception

Uri uri = Uri.parse("file:///sdcard/xxx/log.txt");
Intent viewTestLogFileIntent = new Intent(Intent.ACTION_EDIT);
viewTestLogFileIntent.setData(uri);
viewTestLogFileIntent.setType("text/plain");

code3: which i tried and working fine

Uri uri = Uri.parse("file:///sdcard/xxx/log.txt");
Intent viewTestLogFileIntent = new Intent(Intent.ACTION_EDIT);
viewTestLogFileIntent.setDataAndType(uri,"text/plain");

Two doubts i have are

  1. First of all my file is located in /mnt/sdcard/xxx/log.txt this i can clearly see in the file system in DDMS view of eclipse, but how is it working when i give the file link in uri as “file:///sdcard/xxx/log.txt” where i skipped /mnt from path

  2. what is wrong with code1 and code2?
    what ever is the data and type i am setting in code3 i am setting same data and type on intent but with different methods like setData() and setType() seperately. why are they ( code2 & code1) not working? why is the code3 working?

  • 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-18T10:09:46+00:00Added an answer on June 18, 2026 at 10:09 am

    Please see the Javadoc of the method setType(String type) in the class Intent:

    …

    This method automatically clears any data that was previously set (for example by setData(Uri)).
    …

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

Sidebar

Related Questions

We recently had one of our JVM's crash, leaving behind a core dump file
I had an issue where downloading to a local file was locking it until
So I'm facing this issue, one I've never had before in over 4 years
So I am using Jquery mobile with great success except for one issue. Now
I had one Git repository (A) which contains the development of a project until
For example if I had one or more 2D vectors and I just want
When I looked at: http://replicaisland.googlecode.com/svn/trunk/res/drawable/ and found it only had one set of images,
I have wrote a script that was run from a spreadsheet. I had One
I've messed with Access a little bit in the past, had one class on
I am creating a WCF service. At first I had one WCF service library

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.