Alright, so I have an app that has a custom folder:
I want to open the following types:
protected String[] acceptableTypes = {"jpg", "gif", "png", "bmp", "pdf", "txt"};
I can open the images or at least the jgps for sure with the following code whenever I click on the file:
MediaScannerConnection.scanFile(((Activity) getContext()), new String[] { filePath }, null,
new MediaScannerConnection.OnScanCompletedListener() {
@Override public void onScanCompleted(String path, Uri uri) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri, "image/*");
((Activity) getContext()).startActivityForResult(intent, ConferenceActivity.ACTIVITY_SELECT_IMAGE);
}
});
Now how can I filter this so that I can open the correct file type with the correct program?