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?
Share
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:
Then you need to create your MyBroadcastReceiver class like this:
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.