Home>

I am developing my own Web-code editor and I want that when I click on a certain file (namely html, js, css and txt), the editor (MainActivity) opens and all the text from the file is inserted into the EditText. I know that you can open it like this:

<
intent-filter >
    <
action android: name= "android.intent.action.VIEW" />
    <
data
           android: scheme= "file"
           android: host= "*"
           android: mimeType= "* /*"
           android: pathPattern= ". * \\. html" />
    <
category android: name= "android.intent.category.DEFAULT" />
<
/intent-filter >

But how to process information from a file?

in general you are looking in the wrong direction. manifesto here what side?

DrMcSheen2021-02-23 18:21:06

If I'm not mistaken, then you should have a service that catches signals of a specific function (for example, text editing). And when you click on the file, you will be asked what you can open through this program. That is, clicking on a file sends a request to all programs who can process it, and your application must receive and process it later.

Mako Storm2021-02-23 18:21:06