当前位置: 首页>>代码示例>>Java>>正文


Java Fragment.startActivityForResult方法代码示例

本文整理汇总了Java中android.app.Fragment.startActivityForResult方法的典型用法代码示例。如果您正苦于以下问题:Java Fragment.startActivityForResult方法的具体用法?Java Fragment.startActivityForResult怎么用?Java Fragment.startActivityForResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.app.Fragment的用法示例。


在下文中一共展示了Fragment.startActivityForResult方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startReceivingAisFromAntenna

import android.app.Fragment; //导入方法依赖的package包/类
public static boolean startReceivingAisFromAntenna(final Fragment fragment,final int reqCode,final int ppm) {
	final String tag="startReceivingAisFromAntenna - ";
	Log.d(TAG,tag);
	boolean result=false;
	final String arguments = "-p " + ppm + " -P "+ NmeaClientService.NMEA_UDP_PORT+" -h " + NmeaClientService.NMEA_UDP_HOST + " -R -x -S 60 -n";
	final Intent intent=createOpenDeviceIntent(fragment,arguments);
	if (intent!=null){
		fragment.startActivityForResult(intent, reqCode);
		result=true;
	}
	return result;
}
 
开发者ID:videgro,项目名称:Ships,代码行数:13,代码来源:FragmentUtils.java

示例2: changeRtlSdrPpm

import android.app.Fragment; //导入方法依赖的package包/类
public static boolean changeRtlSdrPpm(final Fragment fragment,final int reqCode,final int ppm) {
	final String tag="changeRtlSdrPpm - ";
	Log.d(TAG,tag);
	boolean result=false;
	final Intent intent=createOpenDeviceIntent(fragment,null);		
	if (intent!=null){
		// Request to change PPM instead of (re)starting RTL-SDR
		intent.putExtra(OpenDeviceActivity.EXTRA_CHANGE_PPM,ppm);

		fragment.startActivityForResult(intent, reqCode);
		result=true;
	}
	return result;
}
 
开发者ID:videgro,项目名称:Ships,代码行数:15,代码来源:FragmentUtils.java

示例3: stopReceivingAisFromAntenna

import android.app.Fragment; //导入方法依赖的package包/类
public static boolean stopReceivingAisFromAntenna(final Fragment fragment,final int reqCode){
	final String tag="stopReceivingAisFromAntenna - ";		
	Log.d(TAG,tag);
	boolean result=false;
	final Intent intent=createOpenDeviceIntent(fragment,null);
	if (intent!=null){
		intent.putExtra(OpenDeviceActivity.EXTRA_DISCONNECT, Boolean.TRUE);
		fragment.startActivityForResult(intent, reqCode);
		result=true;
	}
	return result;
}
 
开发者ID:videgro,项目名称:Ships,代码行数:13,代码来源:FragmentUtils.java

示例4: pickImage

import android.app.Fragment; //导入方法依赖的package包/类
/**
 * Pick image from a Fragment with a custom request code
 *
 * @param context     Context
 * @param fragment    Fragment to receive result
 * @param requestCode requestCode for result
 */
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static void pickImage(Context context, Fragment fragment, int requestCode) {
    try {
        fragment.startActivityForResult(getImagePicker(), requestCode);
    } catch (ActivityNotFoundException e) {
        showImagePickerError(context);
    }
}
 
开发者ID:mityung,项目名称:XERUNG,代码行数:16,代码来源:Crop.java

示例5: requestSysCamera

import android.app.Fragment; //导入方法依赖的package包/类
/**
 * Fragment调用系统拍照
 *
 * @param fragment
 * @param requestCode
 */
public void requestSysCamera(Fragment fragment, int requestCode) {
    requestCamaraPath = getPhotoTmpPath();
    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    intent.putExtra(MediaStore.Images.Media.ORIENTATION, 0);
    intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(requestCamaraPath)));
    fragment.startActivityForResult(intent, requestCode);
}
 
开发者ID:quickhybrid,项目名称:quickhybrid-android,代码行数:14,代码来源:PhotoSelector.java

示例6: addAccount

import android.app.Fragment; //导入方法依赖的package包/类
/**
 * Triggers Android's account adding dialog from a fragment.
 * @param fragment A fragment
 * @param result An intent result code
 */
public void addAccount(Fragment fragment, int result) {
    Intent addGoogleAccount = createAddGoogleAccountIntent();
    if (addGoogleAccount.resolveActivity(fragment.getActivity().getPackageManager()) != null) {
        fragment.startActivityForResult(addGoogleAccount, result);
    } else {
        onOpenAddGoogleAccountPageFailed(fragment.getActivity(), result);
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:14,代码来源:AccountAdder.java

示例7: pickImageFromGallery

import android.app.Fragment; //导入方法依赖的package包/类
/**
 * Pick image from a Fragment with a custom request code
 *
 * @param context     Context
 * @param fragment    Fragment to receive result
 * @param requestCode requestCode for result
 */
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static void pickImageFromGallery(Context context, Fragment fragment, int requestCode) {
    try {
        fragment.startActivityForResult(getGalleryImagePicker(), requestCode);
    } catch (ActivityNotFoundException e) {
        e.printStackTrace();
        showMessage(context,e.getMessage());
    }
}
 
开发者ID:KaranMavadhiya,项目名称:Android_ImagePicker,代码行数:17,代码来源:ImagePickerDialog.java

示例8: startForResult

import android.app.Fragment; //导入方法依赖的package包/类
/**
 * same as {@link Fragment#startActivityForResult(Intent, int)}
 */
public void startForResult(Fragment f, int requestCode) {
  f.startActivityForResult(getIntent(), requestCode);
}
 
开发者ID:douo,项目名称:ActivityBuilder,代码行数:7,代码来源:BaseActivityBuilder.java

示例9: start

import android.app.Fragment; //导入方法依赖的package包/类
@TargetApi(11)
public void start(@NonNull Context context, @NonNull Fragment fragment, int requestCode) {
    fragment.startActivityForResult(getIntent(context), requestCode);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:5,代码来源:UCrop.java

示例10: start

import android.app.Fragment; //导入方法依赖的package包/类
/**
 * Send the crop Intent with a custom request code
 *
 * @param context     Context
 * @param fragment    Fragment to receive result
 * @param requestCode requestCode for result
 */
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void start(Context context, Fragment fragment, int requestCode) {
    fragment.startActivityForResult(getIntent(context), requestCode);
}
 
开发者ID:mityung,项目名称:XERUNG,代码行数:12,代码来源:Crop.java

示例11: goFileChooseActivity

import android.app.Fragment; //导入方法依赖的package包/类
/**
 * 进入文件选择界面
 *
 * @param fragment
 * @param requestCode
 */
public static void goFileChooseActivity(Fragment fragment, int requestCode) {
    Intent intent = new Intent(fragment.getActivity(), FileChooseActivity.class);
    fragment.startActivityForResult(intent, requestCode);
}
 
开发者ID:quickhybrid,项目名称:quickhybrid-android,代码行数:11,代码来源:FileChooseActivity.java

示例12: requestPhotoPick

import android.app.Fragment; //导入方法依赖的package包/类
/**
 * Fragment调用系统相册
 *
 * @param fragment
 * @param requestCode
 */
public void requestPhotoPick(Fragment fragment, int requestCode) {
    Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
    fragment.startActivityForResult(intent, requestCode);
}
 
开发者ID:quickhybrid,项目名称:quickhybrid-android,代码行数:11,代码来源:PhotoSelector.java

示例13: openActivity

import android.app.Fragment; //导入方法依赖的package包/类
/**
 * open gallery
 *
 * @param activity    parent activity
 * @param requestCode {@link Activity#onActivityResult}
 * @param config      {@link GalleryConfig}
 */
public static void openActivity(Fragment activity, int requestCode, GalleryConfig config) {
    Intent intent = new Intent(activity.getActivity(), GalleryActivity.class);
    intent.putExtra(GALLERY_CONFIG, config);
    activity.startActivityForResult(intent, requestCode);
}
 
开发者ID:chengzichen,项目名称:KrGallery,代码行数:13,代码来源:GalleryActivity.java

示例14: start

import android.app.Fragment; //导入方法依赖的package包/类
/**
 * Send the crop Intent with a custom request code
 *
 * @param fragment    Fragment to receive result
 * @param requestCode requestCode for result
 */
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void start(@NonNull Context context, @NonNull Fragment fragment, int requestCode) {
    fragment.startActivityForResult(getIntent(context), requestCode);
}
 
开发者ID:BrandonVargas,项目名称:AndroidOCRFforID,代码行数:11,代码来源:UCrop.java


注:本文中的android.app.Fragment.startActivityForResult方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。