當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。