• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help Open specific file with Specific application

Please help i have a file that i need to open with a specific application
but i cant get to to open


public String get_mime_type(String url) {
String ext = MimeTypeMap.getFileExtensionFromUrl(url);
String mime = null;
if (ext != null) {
mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(ext);
}
return mime;
}
private void openovpn(){

Intent intent = new Intent(Intent.ACTION_GET_CONTENT); Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath() + "/Downloads/");
intent.setDataAndType(uri,"*/*");
intent.setAction(Intent.ACTION_DEFAULT);


startActivityForResult(intent, RQS_OPEN);

Toast.makeText(VpnConfig.this,
"Single-selection: Tap on any file.\n" +
"Multi-selection: Tap & Hold on the first file, " +
"tap for more, tap on OPEN to finish.",
Toast.LENGTH_LONG).show();


}
 
Back
Top Bottom