本文整理汇总了Java中com.ipaulpro.afilechooser.utils.FileUtils.createGetContentIntent方法的典型用法代码示例。如果您正苦于以下问题:Java FileUtils.createGetContentIntent方法的具体用法?Java FileUtils.createGetContentIntent怎么用?Java FileUtils.createGetContentIntent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ipaulpro.afilechooser.utils.FileUtils
的用法示例。
在下文中一共展示了FileUtils.createGetContentIntent方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPath
import com.ipaulpro.afilechooser.utils.FileUtils; //导入方法依赖的package包/类
public void getPath(PathPreference pathPrefToSetValue)
{
pathPref = pathPrefToSetValue;
Intent getContentIntent = FileUtils.createGetContentIntent();
Intent intent = Intent.createChooser(getContentIntent, "Select a file");
startActivityForResult(intent, PATH_REQUEST_CODE);
}
示例2: showChooser
import com.ipaulpro.afilechooser.utils.FileUtils; //导入方法依赖的package包/类
private void showChooser() {
// Use the GET_CONTENT intent from the utility class
Intent target = FileUtils.createGetContentIntent();
// Create the chooser Intent
Intent intent = Intent.createChooser(
target, getString(R.string.chooser_title));
try {
startActivityForResult(intent, REQUEST_CODE);
} catch (ActivityNotFoundException e) {
// The reason for the existence of aFileChooser
}
}
示例3: onPickAFileClicked
import com.ipaulpro.afilechooser.utils.FileUtils; //导入方法依赖的package包/类
@OnClick(R.id.mPickAFileButton)
public void onPickAFileClicked() {
// Create the ACTION_GET_CONTENT Intent
Intent getContentIntent = FileUtils.createGetContentIntent();
Intent intent = Intent.createChooser(getContentIntent,
getString(R.string.pick_a_file));
startActivityForResult(intent, REQUEST_CHOOSER);
}
示例4: selectUploadFile
import com.ipaulpro.afilechooser.utils.FileUtils; //导入方法依赖的package包/类
public void selectUploadFile(View view) {
Intent target = FileUtils.createGetContentIntent();
Intent intent = Intent.createChooser(target,
this.getString(R.string.choose_file));
try {
this.startActivityForResult(intent, REQUEST_CODE);
} catch (ActivityNotFoundException ex) {
}
}
示例5: showChooser
import com.ipaulpro.afilechooser.utils.FileUtils; //导入方法依赖的package包/类
private void showChooser() {
Intent target = FileUtils.createGetContentIntent();
Intent intent = Intent.createChooser(
target, "Selece a file");
try {
startActivityForResult(intent, REQUEST_CODE);
} catch (ActivityNotFoundException e) {
// The reason for the existence of aFileChooser
}
}
示例6: showFileChooser
import com.ipaulpro.afilechooser.utils.FileUtils; //导入方法依赖的package包/类
private void showFileChooser() {
// Use the GET_CONTENT intent from the utility class
Intent target = FileUtils.createGetContentIntent();
// Create the chooser Intent
Intent intent = Intent.createChooser(
target, this.cordova.getActivity().getString(R.string.chooser_title));
try {
this.cordova.startActivityForResult((CordovaPlugin) this, intent, REQUEST_CODE);
} catch (ActivityNotFoundException e) {
// The reason for the existence of aFileChooser
}
}
示例7: showChooser
import com.ipaulpro.afilechooser.utils.FileUtils; //导入方法依赖的package包/类
private void showChooser() {
// Use the GET_CONTENT intent from the utility class
Intent target = FileUtils.createGetContentIntent();
// Create the chooser Intent
target.setType(FileUtils.MIME_TYPE_AUDIO);
Intent intent = Intent.createChooser(target, getString(R.string.chooser_title));
try {
startActivityForResult(intent, REQUEST_CODE);
} catch (ActivityNotFoundException e) {
// The reason for the existence of aFileChooser
}
}
示例8: onOptionsItemSelected
import com.ipaulpro.afilechooser.utils.FileUtils; //导入方法依赖的package包/类
/**
* Called when a MenuItem is clicked. Handles adding of items
*
* @param item
* @return
*/
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.content_add:
Intent getContentIntent = FileUtils.createGetContentIntent();
Intent intent = Intent.createChooser(getContentIntent, "Select a file");
((HomeActivity) getActivity()).setRequestedActivity(true);
startActivityForResult(intent, REQUEST_CHOOSER);
return true;
case R.id.content_image_capture:
mTempResultFile = Utils.getRandomCacheFile(".jpg");
Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(mTempResultFile));
((HomeActivity) getActivity()).setRequestedActivity(true);
startActivityForResult(cameraIntent, CONTENT_REQUEST);
return true;
case R.id.content_video_capture:
mTempResultFile = Utils.getRandomCacheFile(".mp4");
Intent videoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
videoIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(mTempResultFile));
((HomeActivity) getActivity()).setRequestedActivity(true);
startActivityForResult(videoIntent, CONTENT_REQUEST);
return true;
case R.id.content_audio_capture:
mTempResultFile = Utils.getRandomCacheFile(".3gp");
((HomeActivity) getActivity()).setRequestedActivity(true);
Intent audioIntent = new Intent(getActivity(), RecorderActivity.class);
audioIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(mTempResultFile));
startActivityForResult(audioIntent, CONTENT_REQUEST);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
示例9: importFileChooser
import com.ipaulpro.afilechooser.utils.FileUtils; //导入方法依赖的package包/类
private void importFileChooser(int format) {
Intent target = FileUtils.createGetContentIntent();
// target.setType(FileUtils.MIME_TYPE_TEXT);
Intent intent = Intent.createChooser(target, getString(R.string.chooser_title));
try {
startActivityForResult(intent, format);
} catch (ActivityNotFoundException e) {
// The reason for the existence of aFileChooser
}
}
示例10: pickIcon
import com.ipaulpro.afilechooser.utils.FileUtils; //导入方法依赖的package包/类
/**
* Lets the user pick a new icon from their own folder
*/
private void pickIcon() {
Intent getContentIntent = FileUtils.createGetContentIntent();
getContentIntent.setType("image/*");
Intent intent = Intent.createChooser(getContentIntent, Utils.str(R.string.morph_select_image));
((HomeActivity) getActivity()).setRequestedActivity(true);
startActivityForResult(intent, REQUEST_CHOOSER);
}
示例11: requestFileChooser
import com.ipaulpro.afilechooser.utils.FileUtils; //导入方法依赖的package包/类
public void requestFileChooser(OnFileChosenListener requester) {
currentFileChoiceListener = requester;
Intent target = FileUtils.createGetContentIntent();
Intent intent = Intent.createChooser(target,
getResources().getString(R.string.file_select));
try {
startActivityForResult(intent, REQCODE_FILECHOOSE);
} catch (ActivityNotFoundException e) {
// The reason for the existence of aFileChooser
}
}
示例12: openSelectPicDialog
import com.ipaulpro.afilechooser.utils.FileUtils; //导入方法依赖的package包/类
private void openSelectPicDialog()
{
Intent getContentIntent = FileUtils.createGetContentIntent();
Intent intent = Intent.createChooser(getContentIntent, "Select a file");
startActivityForResult(intent, REQUEST_CODE);
}
示例13: showImportDialog
import com.ipaulpro.afilechooser.utils.FileUtils; //导入方法依赖的package包/类
protected void showImportDialog() {
Intent target = FileUtils.createGetContentIntent();
Intent intent = Intent.createChooser(
target, "Select survey to import");
startActivityForResult(intent, IMPORT_SURVEY_REQUEST_CODE);
}
示例14: startFileChooser
import com.ipaulpro.afilechooser.utils.FileUtils; //导入方法依赖的package包/类
public void startFileChooser(){
Intent getContentIntent = FileUtils.createGetContentIntent();
Intent intent = Intent.createChooser(getContentIntent, getString(R.string.print_select_a_document));
startActivityForResult(intent, REQUEST_CHOOSER);
}