Please help me about this question.
I know how to open a file by default app like this :
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
File file = ExternalStorageHelper.getFileFromName(fileName);
MimeTypeMap mime = MimeTypeMap.getSingleton();
String ext =fileName.substring(fileName.lastIndexOf(".")+1);
String type = mime.getMimeTypeFromExtension(ext);
if(type != null){
if(mime.hasMimeType(type)){
intent.setDataAndType(Uri.fromFile(file),type);
containActivity.startActivityForResult(intent,1);
}else{
Toast t = Toast.makeText(containActivity, R.string.download_open_file_error_message, Toast.LENGTH_SHORT);
t.show();
}
}else{
Toast t = Toast.makeText(containActivity, R.string.download_open_file_error_message, Toast.LENGTH_SHORT);
t.show();
}
but I can’t find out how to open a folder by default app.
From this code how can I determine to MimeTypeMap fileName is a Directory.
I am really need it now, please help me 🙂
How do I open the file browser? ( Android SDK)