I am using Storage Access Framework and want to create a folder (location choosed by user through file picker) but instead it is creating a file without any extension.
I am using ACTION_CREATE_DOCUMENT
for this, you can check the intent call below:
Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
intent.setType("application/vnd.google-apps.folder");
intent.putExtra(Intent.EXTRA_TITLE, "CCM-Tele ICU");
startActivityForResult(intent, MAKE_DIRECTORY_REQUEST_ID);
But instead of folder it is creating this:
I have tried creating files and it works fine but unfortunately, folder is not being created.
I solved the problem of directory creation so answering my own question maybe it will help someone in future.
The Mime type that I was using is incorrect. So change it to:
DocumentsContract.Document.MIME_TYPE_DIR
But it's useless as I can't use it to store things afterwards using SAF. So it's better to use
ACTION_OPEN_DOCUMENT_TREE
instead