The flow is:
Step #1: Delete String filePathName = "WHAT TODO ?";
Step #2: Change LaterFunction(filePathName);
to LaterFunction(uri);
Step #3: Change br = new BufferedReader(new FileReader("WHAT TODO ?"));
to br = new BufferedReader(new InputStreamReader(getContentResolver().openInputStream(uri));
That is the minimum necessary to address your question.
However, a MIME type of */*
will match any type of file, not just text files. Binary files should not be copied using readLine()
. If you only want plain text files, use text/plain
instead of */*
.