本文整理汇总了Java中com.google.zxing.integration.android.IntentIntegrator.forSupportFragment方法的典型用法代码示例。如果您正苦于以下问题:Java IntentIntegrator.forSupportFragment方法的具体用法?Java IntentIntegrator.forSupportFragment怎么用?Java IntentIntegrator.forSupportFragment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.zxing.integration.android.IntentIntegrator
的用法示例。
在下文中一共展示了IntentIntegrator.forSupportFragment方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: callScanner
import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
/**
* Inicia el lector de barras.
* Devuelve el resultado por {@link #onActivityResult(int, int, Intent)}.
*/
private void callScanner() {
IntentIntegrator integrator = IntentIntegrator.forSupportFragment(this);
integrator.setDesiredBarcodeFormats(IntentIntegrator.ONE_D_CODE_TYPES);
integrator.setPrompt(getString(R.string.balance_align_barcode));
integrator.setBeepEnabled(false);
integrator.setBarcodeImageEnabled(true);
integrator.initiateScan();
}
示例2: scan
import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
/**
* 打开二维码
* <p>
* 参数:
* videoUrl:视频地址
*/
public static void scan(IQuickFragment webLoader, WebView wv, JSONObject param, Callback callback) {
Object fragment = webLoader.getPageControl().getFragment();
IntentIntegrator integrator = null;
if (fragment instanceof Fragment) {
integrator = IntentIntegrator.forFragment((Fragment) fragment);
} else if (fragment instanceof android.support.v4.app.Fragment) {
integrator = IntentIntegrator.forSupportFragment((android.support.v4.app.Fragment) fragment);
}
if (integrator != null) {
integrator.setCaptureActivity(ScanCaptureActivity.class);
integrator.initiateScan();
webLoader.getWebloaderControl().addPort(AutoCallbackDefined.OnScanCode, callback.getPort());
}
}
示例3: decodeUseCamera
import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
private void decodeUseCamera() {
IntentIntegrator integrator = IntentIntegrator.forSupportFragment(this);
integrator.setBeepEnabled(true);
integrator.setBarcodeImageEnabled(true);
integrator.setOrientationLocked(true);
integrator.initiateScan();
}
示例4: startBarcodeScan
import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
/**
* Start scanning activity with any screen orientation
*/
private void startBarcodeScan() {
IntentIntegrator integrator = IntentIntegrator.forSupportFragment(this);
integrator.setCaptureActivity(CaptureAnyOrientationActivity.class);
integrator.setOrientationLocked(false);
integrator.initiateScan();
}