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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:37:44+00:00 2026-06-06T16:37:44+00:00

I have an activity that opens txt files. And everytime a user wants to

  • 0

I have an activity that opens txt files. And everytime a user wants to open a txt file, my app will be able to open it. My question is, how do I pass the path of the file to be opened to my activity? And, how do I receive the path programmatically? In short, what are the things I have to do besides setting the intent filter in the manifest file to allow my app to open a txt file upon clicking that file?

  • 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-06T16:37:45+00:00Added an answer on June 6, 2026 at 4:37 pm

    You will need to use a Broadcast Receiver, but not sure what intent-filter you have to use.

    Maybe something to try is adding something like this to your manifest:

    <receiver android:name="MyBroadcastReceiver">
      <intent-filter>
        <action android:name="android.intent.action.ACTION_VIEW" />
        <action android:name="android.intent.action.ACTION_EDIT" />
        <action android:name="android.intent.action.ACTION_PICK" />
      </intent-filter>
    </receiver>
    

    Then you need to create your MyBroadcastReceiver class like this:

    public final class MyBroadcastReceiver extends BroadcastReceiver
    {
      @Override
      public void onReceive(Context context, Intent intent)
      {
        // Your receiver code here...
      }
    }
    

    And then check into the onReceive method the data received into the Intent when you try to open a file. That way you may know what data will arrive into the Intent.

    Hope it helps.

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

Sidebar

Related Questions

I have a database in one activity that I want to open in another
I have an activity that when users press share on a file it would
I have an activity that contains several user editable items (an EditText field, RatingBar,
I have an Activity that opens the Camera and starts a preview on a
I have an app that has a list as its main activity and then
Android 2.1 via eclipse I have an activity that opens a dialog themed activity
I have Activity A. It opens Activity B that is a dialog Activity with
I have an activity with ListView that has: android:theme=@android:style/Theme.Dialog in Manifest. When I open
I have an activity (A) with a listview that opens a second activity (B)
let's have activity A and button in that activity, which opens activity A again.

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.