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

  • Home
  • SEARCH
  • 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 8559227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:59:30+00:00 2026-06-11T15:59:30+00:00

Possible Duplicate: Intent for editing plain text file with the installed file editor (if

  • 0

Possible Duplicate:
Intent for editing plain text file with the installed file editor (if any)

I am trying to open some text file which I have downloaded. When I start the activity with intent it gives ActivityNotFound Exception.

try {
    Uri path = Uri.parse(path+"/sampletext.txt");
    Intent intent = new Intent(Intent.ACTION_VIEW);
    PackageManager packageManager = ctx.getPackageManager();
    intent.setType("text/plain") ;
    List<ResolveInfo> list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
    if (list.size() > 0 ) {
        intent.setDataAndType(path, "text/plain");
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        ctx.startActivity(intent) ;
    } 

} catch (Exception e){
    e.printStackTrace() ;
}

When I debugged, I found that the list.size is 1.

Is there any other information which I am missing?

Any kind of points would help me.

Thanks.

  • 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-11T15:59:32+00:00Added an answer on June 11, 2026 at 3:59 pm

    ActivityNotFound Exception is generally encoutered when there is no matching activity declared in the manifest file or registered by another application as a shared activity.

    You may need to edit your path:

    Uri path = Uri.parse("file://" + path + "/sampletext.txt");

    a better way to do this is to use the convenience method:

    Uri data = Uri.fromFile(file);

    but you would need to create a File object to use that method

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

Sidebar

Related Questions

Possible Duplicate: Intent to launch the clock application on android I have a widget
Possible Duplicate: regex for URL including query string I have a text or message.
Possible Duplicate: Calling Method in Android I'm trying to contatct an API. I have
Possible Duplicate: Passing a Int value to another class I have been trying to
Possible Duplicate: What is a Sticky Intent? [Android] I've found that some applications require
Possible Duplicate: Objective C for Windows iPhone development on Windows Is there any way
Possible Duplicate: Gallery with folder filter I'm using following code to open a gallery
Possible Duplicate: Extracting dollar amounts from existing sql data? I have a column in
Possible Duplicate: How to put a List in intent I want to pass a
Possible Duplicate: Using global exception handling with “setUncaughtExceptionHandler” and “Toast” I have implemented UncaughtExceptionHandler

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.