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