/*
* Get the Intent for selecting content to be used in an Intent Chooser.
* @return The intent for opening a file with Intent.createChooser()
* @author paulburke
_/
public static Intent createGetContentIntent() {
// // Implicitly allow the user to select a particular kind of data
// final Intent intent = new Intent(Intent.ACTION_GETCONTENT);
// // The MIME data type filter
// intent.setType("/*");
// // Only return URIs that can be opened with ContentResolver
// intent.addCategory(Intent.CATEGORY_OPENABLE);
// return intent;
return createGetContentIntent(null);
}
/**
* Get the Intent for selecting content to be used in an Intent Chooser.
*
* @param type Set the type for intent.
* @return The intent for opening a file with Intent.createChooser()
* @author AlexZHOU
*/
public static Intent createGetContentIntent(final String type) {
// Implicitly allow the user to select a particular kind of data
final Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
// The MIME data type filter
intent.setType(type != null ? type : "*/*");
// Only return URIs that can be opened with ContentResolver
intent.addCategory(Intent.CATEGORY_OPENABLE);
return intent;
}
/* * Get the Intent for selecting content to be used in an Intent Chooser. * @return The intent for opening a file with Intent.createChooser() * @author paulburke _/ public static Intent createGetContentIntent() { // // Implicitly allow the user to select a particular kind of data // final Intent intent = new Intent(Intent.ACTION_GETCONTENT); // // The MIME data type filter // intent.setType("/*"); // // Only return URIs that can be opened with ContentResolver // intent.addCategory(Intent.CATEGORY_OPENABLE); // return intent; return createGetContentIntent(null); }