How to pick only sqlite db file using intent in android

Viewed 195

How to set intent type so that it only show .db file. What is the mimetype of sqlite sb. I have tried the solution to this question Android: what is the mime type to use if I want to see/pick a SQLite database from the Downloads folder? but not working.

Currently, I am doing like this:

    Intent newIntent = new Intent(Intent.ACTION_GET_CONTENT);
    newIntent.setType("application/vnd.sqlite3");
    newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    newIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
    startActivityForResult(newIntent,FILE_PICKER_REQUEST_CODE);

But it shows all type of file

1 Answers

You can't.
I've pulled android internal database with all files and it stores sqlite databases without mime type.

enter image description here

Related