W
W
Warog2017-03-10 21:36:51
Android
Warog, 2017-03-10 21:36:51

How to open a file in another application on android?

I need to solve this problem: I want to be able to transfer any file from my application to another application that can open it. For example, open a photo in the gallery. How to do it?
Tried like this:

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.fromFile(dir));
            intent.setType("*/*");
            startActivity(intent);

A window opens with all applications, I select a gallery to open a photo. The gallery opens, but the photo itself doesn't. When I try to open it through another application (ES Explorer), it says "Image not found".
I'm a beginner, don't judge strictly.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question