if(file.toString().endsWith(".png") || file.toString().endsWith(".jpg")
|| file.toString().endsWith(".gif")){
Intent picture = new Intent(Intent.ACTION_VIEW);
Uri picUri = Uri.parse(" ());
picture.setDataAndType(picUri, "image/*");
startActivity(picture);
}else if(file.toString().endsWith(".mp3") || file.toString().endsWith(".wma")){
Intent audio = new Intent(Intent.ACTION_VIEW);
Uri audUri = Uri.parse("file://" + file.getPath());
audio.setDataAndType(audUri, "audio/*");
startActivity(audio);
}else if(file.toString().endsWith(".mp4") || file.toString().endsWith(".3gp")
|| file.toString().endsWith(".avi")){
Intent video = new Intent(Intent.ACTION_VIEW);
Uri vidUri = Uri.parse("file://" + file.getPath());
video.setDataAndType(vidUri, "video/*");
startActivity(video);
}else if(file.toString().endsWith(".apk")){
Intent setup = new Intent(Intent.ACTION_VIEW);
setup.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Uri setupUri = Uri.parse("file://" + file.getPath());
setup.setDataAndType(setupUri, "application/vnd.android.package-archive");
startActivity(setup);
}else{
Intent setupIntent = new Intent(Intent.ACTION_VIEW);
Uri setupUri = Uri.parse(" ());
setupIntent.setData(null);
startActivity(setupIntent);
}
|| file.toString().endsWith(".gif")){
Intent picture = new Intent(Intent.ACTION_VIEW);
Uri picUri = Uri.parse(" ());
picture.setDataAndType(picUri, "image/*");
startActivity(picture);
}else if(file.toString().endsWith(".mp3") || file.toString().endsWith(".wma")){
Intent audio = new Intent(Intent.ACTION_VIEW);
Uri audUri = Uri.parse("file://" + file.getPath());
audio.setDataAndType(audUri, "audio/*");
startActivity(audio);
}else if(file.toString().endsWith(".mp4") || file.toString().endsWith(".3gp")
|| file.toString().endsWith(".avi")){
Intent video = new Intent(Intent.ACTION_VIEW);
Uri vidUri = Uri.parse("file://" + file.getPath());
video.setDataAndType(vidUri, "video/*");
startActivity(video);
}else if(file.toString().endsWith(".apk")){
Intent setup = new Intent(Intent.ACTION_VIEW);
setup.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Uri setupUri = Uri.parse("file://" + file.getPath());
setup.setDataAndType(setupUri, "application/vnd.android.package-archive");
startActivity(setup);
}else{
Intent setupIntent = new Intent(Intent.ACTION_VIEW);
Uri setupUri = Uri.parse(" ());
setupIntent.setData(null);
startActivity(setupIntent);
}