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


Java IntentIntegrator.initiateScan方法代码示例

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


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

示例1: onOptionsItemSelected

import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
  switch (item.getItemId()) {
    case R.id.action_refresh:
      createWeexInstance();
      renderPage();
      break;
    case R.id.action_scan:
      IntentIntegrator integrator = new IntentIntegrator(this);
      integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
      integrator.setPrompt("Scan a barcode");
      //integrator.setCameraId(0);  // Use a specific camera of the device
      integrator.setBeepEnabled(true);
      integrator.setOrientationLocked(false);
      integrator.setBarcodeImageEnabled(true);
      integrator.setPrompt(getString(R.string.capture_qrcode_prompt));
      integrator.initiateScan();
      break;
    case android.R.id.home:
      finish();
    default:
      break;
  }

  return super.onOptionsItemSelected(item);
}
 
开发者ID:wangwei123,项目名称:my-weex,代码行数:27,代码来源:WXPageActivity.java

示例2: onClick

import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
    if (textBack.equals(v)) {
        finish();
    } else if (textScan.equals(v)) {
        IntentIntegrator integrator = new IntentIntegrator(this);
        integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
        integrator.setPrompt("Scan a barcode");
        //integrator.setCameraId(0);  // Use a specific camera of the device
        integrator.setBeepEnabled(true);
        integrator.setOrientationLocked(false);
        integrator.setBarcodeImageEnabled(true);
        integrator.setPrompt("请将条码置于取景框内扫描");
        integrator.initiateScan();
    } else if (btnSave.equals(v)) {
        save();
    } else if (btnReset.equals(v)) {
        save();
        AppExitUtil.restart(this);
    } else if (btnOpen.equals(v)) {
        String page = editOpen.getText().toString().trim();
        UWXJumpUtil.openPage(this, page);
    }
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:25,代码来源:WXDebugActivity.java

示例3: 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();
}
 
开发者ID:AIDEA775,项目名称:UNCmorfi,代码行数:13,代码来源:BalanceFragment.java

示例4: onOptionsItemSelected

import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case R.id.action_refresh:
            createWeexInstance();
            renderPage();
            break;
        case R.id.action_scan:
            IntentIntegrator integrator = new IntentIntegrator(this);
            integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
            integrator.setPrompt("Scan a barcode");
            //integrator.setCameraId(0);  // Use a specific camera of the device
            integrator.setBeepEnabled(true);
            integrator.setOrientationLocked(false);
            integrator.setBarcodeImageEnabled(true);
            integrator.initiateScan();
            //scanQrCode();
            break;
        default:
            break;
    }

    return super.onOptionsItemSelected(item);
}
 
开发者ID:dodola,项目名称:WeexOne,代码行数:25,代码来源:IndexActivity.java

示例5: actionSearchQrcode

import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
private void actionSearchQrcode() {
        IntentIntegrator integrator = new IntentIntegrator(getActivity());
        integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
        integrator.setOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        integrator.initiateScan();
//        Intent intent = new Intent(getActivity(), FindByQrCode.class);
//        intent.putExtra(FindByQrCode.SCAN_QR_CODE, true);
//        startActivityForResult(intent, MainActivity.RESULT_SCAN);
    }
 
开发者ID:duniter,项目名称:duniter-android-app,代码行数:10,代码来源:IdentityListFragment.java

示例6: onOptionsItemSelected

import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();

    // Insert/Update Food.
    if (id == R.id.action_save_food) {
        saveFood();
    } else if (id == R.id.action_scan_barcode) {
        //Toast.makeText(getActivity(), "Functionality coming soon", Toast.LENGTH_SHORT).show();
        IntentIntegrator integrator = new IntentIntegrator(getActivity());
        integrator.initiateScan();
    } else if (id == R.id.action_delete_food) {
        onFoodDelete();
    }

    return super.onOptionsItemSelected(item);
}
 
开发者ID:miguelpalacio,项目名称:MyMacros,代码行数:18,代码来源:FoodEditorFragment.java

示例7: scanCode

import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void scanCode() {

    try {
        CameraManager manager = (CameraManager) getApplicationContext().getSystemService(Context.CAMERA_SERVICE);
        String[] cameraIds = manager.getCameraIdList();
        for (int i = 0; i < cameraIds.length; i++) {
            CameraCharacteristics characteristics = manager.getCameraCharacteristics(cameraIds[i]);
            if (characteristics.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_BACK) {
                IntentIntegrator integrator = new IntentIntegrator(this);
                integrator.setCameraId(i);
                integrator.initiateScan();
            }
        }
    } catch (CameraAccessException e) {
    }

}
 
开发者ID:wcomartin,项目名称:PlexPy-Remote,代码行数:19,代码来源:ServerQRScannerActivity.java

示例8: onActivityResult

import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
    IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
    if (scanResult != null) {
        String text = getString(R.string.qr_result_init);
        TextView textView = (TextView) findViewById(R.id.qr_result);

        android.util.Log.d("----", scanResult.getContents());

        if (IntentIntegrator.QR_CODE_TYPES.equals(scanResult.getFormatName())) {
            textView.setText(String.format(text, scanResult.getContents()));

            initLoader(scanResult.getContents());

        } else {
            Toast.makeText(this, R.string.bad_bar_code, Toast.LENGTH_SHORT).show();
            IntentIntegrator.initiateScan(this);
        }

    }
}
 
开发者ID:kolipass,项目名称:QR-Code-Auth-Android-client,代码行数:21,代码来源:MainActivity.java

示例9: onCreate

import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		//setContentView(R.layout.send);
		IntentIntegrator ii = new IntentIntegrator(this);
		ii.initiateScan();
		
		
		
//		try {
//			Intent intent = new Intent("com.google.zxing.client.android.SCAN");
//	        intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
//	        startActivityForResult(intent, 0);
//	        
//        } catch (Exception e) {
//
//            Uri marketUri = Uri
//                    .parse("market://details?id=com.google.zxing.client.android");
//            Intent marketIntent = new Intent(Intent.ACTION_VIEW,
//                    marketUri);
//            startActivity(marketIntent);
//
//        }
		
		
	}
 
开发者ID:ksiomelo,项目名称:mailbox-plus-android,代码行数:27,代码来源:ScanActivity.java

示例10: onOptionsItemSelected

import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    boolean result = true;
    switch (item.getItemId()) {
        case R.id.accounts_management_add:
            // use com.google.zxing.android-integration
            IntentIntegrator integrator = new IntentIntegrator(this);
            integrator.initiateScan();
            break;
        case R.id.accounts_management_settings:
            startActivity(new Intent(this, SettingsActivity.class));
            break;
        default:
            result = super.onOptionsItemSelected(item);
            break;
    }
    return result;
}
 
开发者ID:andrei-senchuk,项目名称:mpos-viewer,代码行数:19,代码来源:AccountsManagementActivity.java

示例11: onOptionsItemSelected

import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
	switch (item.getItemId()) {
	case MENU_ITEM_ADD:
		// Launch activity to insert a new item
		IntentIntegrator.initiateScan(this);
		return true;
	case MENU_ITEM_ADD_MANUALLY:
		showDialog(DIALOG_ADD_MANUALLY);
		return true;
	case MENU_ITEM_DELETE_ALL:
		// delete all
		getContentResolver().delete(ResourceManager.Resources.CONTENT_URI,
				"", new String[] {});
		getContentResolver().delete(
				ResourceManager.ResourceBindings.CONTENT_URI, "",
				new String[] {});
		return true;
	}

	return super.onOptionsItemSelected(item);
}
 
开发者ID:interdroid,项目名称:cuckoo-resource-manager,代码行数:23,代码来源:ResourcesList.java

示例12: onOptionsItemSelected

import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
      case R.id.action_about:
        Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/Oxtilo/BetaDroid-Server"));
        startActivity(browserIntent);
        return true;
      case R.id.action_scan:
        IntentIntegrator integrator = new IntentIntegrator(this);
        integrator.initiateScan();
        return true;
      case R.id.action_refresh:
        startRefreshService();
        return true;
    }
    return super.onOptionsItemSelected(item);
}
 
开发者ID:Oxtilo,项目名称:BetaDroid-Android,代码行数:18,代码来源:MainActivity.java

示例13: scan

import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
/**
 * Запуск сканера.
 */
private void scan() {
	if (ACTION_MANUAL_BARCODE.equals(getIntent().getAction())
			&& !barcodeNotified) {
		barcodeNotified = true;
		showDialog(DIALOG_MANUAL_BARCODE_ID);
		return;
	}
	IntentIntegrator integrator = new IntentIntegrator(this);
	AlertDialog alertDialog = integrator.initiateScan(SUPPORTED_CODE_TYPES);
	if (alertDialog != null) {
		alertDialog.dismiss();
		if (!installNotified) {
			installNotified = true;
			showDialog(DIALOG_INSTALL_ID);
		}
	}
}
 
开发者ID:redsolution,项目名称:bst,代码行数:21,代码来源:VerifyActivity.java

示例14: 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();
}
 
开发者ID:tranleduy2000,项目名称:text_converter,代码行数:8,代码来源:BarCodeCodecFragment.java

示例15: 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());
    }
}
 
开发者ID:quickhybrid,项目名称:quickhybrid-android,代码行数:21,代码来源:UtilApi.java


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