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


Java ZXingScannerView.setResultHandler方法代码示例

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


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

示例1: onCreate

import me.dm7.barcodescanner.zxing.ZXingScannerView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_qr_code);
    contentFrame = (ViewGroup) findViewById(R.id.content_frame);
    mScannerView = new ZXingScannerView(this);
    mScannerView.setResultHandler(this);
    if (isCameraAccessAllowed()) {
        contentFrame.addView(mScannerView);
    } else {
        requestStoragePermission();
    }
    mImageView = (ImageView) findViewById(R.id.qr_code_id);
    String data;
    if (getIntent().getExtras() != null) {
        data = getIntent().getExtras().getString(EXTRA_DATA);
    } else {
        data = "Udhari";
    }
    mImageView.setImageBitmap(endcode(data));
}
 
开发者ID:talCrafts,项目名称:Udhari,代码行数:22,代码来源:QrCodeActivity.java

示例2: onCreate

import me.dm7.barcodescanner.zxing.ZXingScannerView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_escaner);
    escanerView = new ZXingScannerView(this);
    setContentView(escanerView);
    escanerView.setResultHandler(this);
    escanerView.startCamera();
}
 
开发者ID:EdwardAlexis,项目名称:Sistema-de-Comercializacion-Negocios-Jhordan,代码行数:10,代码来源:ActivityEscaner.java

示例3: initQRScan

import me.dm7.barcodescanner.zxing.ZXingScannerView; //导入方法依赖的package包/类
public void initQRScan(FrameLayout frame) {
    mScannerView = new ZXingScannerView(this);
    frame.addView(mScannerView);
    mScannerView.setResultHandler(this);
    ArrayList<BarcodeFormat> supported = new ArrayList<BarcodeFormat>();
    supported.add(BarcodeFormat.QR_CODE);
    mScannerView.setFormats(supported);
    mScannerView.startCamera();
}
 
开发者ID:manuelsc,项目名称:Lunary-Ethereum-Wallet,代码行数:10,代码来源:QRScanActivity.java

示例4: onCreate

import me.dm7.barcodescanner.zxing.ZXingScannerView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    checkProvider = new OnlineCheckProvider(this);
    config = new AppConfig(this);

    setContentView(R.layout.activity_main);

    qrView = (ZXingScannerView) findViewById(R.id.qrdecoderview);
    qrView.setResultHandler(this);
    qrView.setAutoFocus(config.getAutofocus());
    qrView.setFlash(config.getFlashlight());

    if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
        ActivityCompat.requestPermissions(this,
                new String[]{Manifest.permission.CAMERA},
                PERMISSIONS_REQUEST_CAMERA);
    }

    List<BarcodeFormat> formats = new ArrayList<>();
    formats.add(BarcodeFormat.QR_CODE);

    qrView.setFormats(formats);

    setVolumeControlStream(AudioManager.STREAM_MUSIC);
    mediaPlayer = buildMediaPlayer(this);

    timeoutHandler = new Handler();

    resetView();

    getSupportActionBar().setDisplayShowHomeEnabled(true);
    getSupportActionBar().setLogo(R.drawable.ic_logo);
    getSupportActionBar().setDisplayUseLogoEnabled(true);
}
 
开发者ID:c3cashdesk,项目名称:postixdroid,代码行数:37,代码来源:MainActivity.java

示例5: onCreate

import me.dm7.barcodescanner.zxing.ZXingScannerView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    scannerView = new ZXingScannerView(this);
    scannerView.setResultHandler(this);
    setContentView(scannerView);
}
 
开发者ID:zacharytamas,项目名称:super-duo,代码行数:8,代码来源:ScannerActivity.java

示例6: QrScanner

import me.dm7.barcodescanner.zxing.ZXingScannerView; //导入方法依赖的package包/类
public void QrScanner(View view){
    mScannerView = new ZXingScannerView(this);   // Programmatically initialize the scanner view
    setContentView(mScannerView);

    mScannerView.setResultHandler(this); // Register ourselves as a handler for scan results.
    mScannerView.startCamera();         // Start camera

}
 
开发者ID:WiserUFBA,项目名称:wiser-services,代码行数:9,代码来源:MainActivity.java

示例7: QrScanner

import me.dm7.barcodescanner.zxing.ZXingScannerView; //导入方法依赖的package包/类
public void QrScanner(View view){
    mScannerView = new ZXingScannerView(this);   // Programmatically initialize the scanner view
    setContentView(mScannerView);
    mScannerView.setResultHandler(this); // Register ourselves as a handler for scan results.
    mScannerView.startCamera();         // Start camera
}
 
开发者ID:Mohnish226,项目名称:SendIt,代码行数:7,代码来源:receiveActivity.java

示例8: scanCode

import me.dm7.barcodescanner.zxing.ZXingScannerView; //导入方法依赖的package包/类
public void scanCode(View v) {
    mScannerView = new ZXingScannerView(this);
    setContentView(mScannerView);
    mScannerView.setResultHandler(this);
    mScannerView.startCamera();
}
 
开发者ID:omralcrt,项目名称:OrderFood,代码行数:7,代码来源:IntroActivity.java

示例9: onCreate

import me.dm7.barcodescanner.zxing.ZXingScannerView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle state) {
    super.onCreate(state);
    ButterKnife.bind(this);


    mScannerView = new ZXingScannerView(this);
    setContentView(mScannerView);

    mScannerView.setResultHandler(this);

    mBindAction = getIntent().getAction();

    mHandler = new Handler(new Handler.Callback() {
        @Override
        public boolean handleMessage(Message msg) {
            switch (msg.what) {
                case MSG_ENTER_DOWNLOAD_ACTIVITY:
                    Log.i(TAG, "Bind succeeded. Enter download activity");
                    DownloadActivity.startDownload(QRCodeScanActivity.this, mUid);
                    break;

                case MSG_ENTER_UPLOAD_ACTIVITY:
                    Log.i(TAG, "Bind succeeded. Enter upload activity");

                    UploadActivity.startUpload(QRCodeScanActivity.this, mUid,
                            PreferenceUtil.getFileItemsToSend(QRCodeScanActivity.this));
                    break;

                case MSG_SERVER_ERROR:
                    Log.i(TAG, "Server error. Stop retrying");
                    Toast.makeText(QRCodeScanActivity.this, R.string.hint_connect_server_error, Toast.LENGTH_LONG).show();
                    finish();
                    break;
                case MSG_DEVICE_OFFLINE:
                    Log.i(TAG, "Device is offline. Stop retrying");
                    Toast.makeText(QRCodeScanActivity.this, R.string.hint_connect_device_offline, Toast.LENGTH_LONG).show();
                    finish();
                    break;
                default:
                    break;
            }
            return false;
        }
    });

    Log.i(TAG, "Scanning QRCode on desktop internet browser");
}
 
开发者ID:YieldNull,项目名称:Biu,代码行数:49,代码来源:QRCodeScanActivity.java

示例10: onResume

import me.dm7.barcodescanner.zxing.ZXingScannerView; //导入方法依赖的package包/类
@Override
public void onResume()
{
	super.onResume();

	grantPermissions();

	mScannerView = new ZXingScannerView(this);

	setContentView(mScannerView);

	mScannerView.setResultHandler(this);
	mScannerView.setAutoFocus(true);

	mScannerView.startCamera();
}
 
开发者ID:olejon,项目名称:mdapp,代码行数:17,代码来源:BarcodeScannerActivity.java

示例11: QrScanner

import me.dm7.barcodescanner.zxing.ZXingScannerView; //导入方法依赖的package包/类
public void QrScanner(View view){

        mScannerView = new ZXingScannerView(this);   // Programmatically initialize the scanner view
        setContentView(mScannerView);

        mScannerView.setResultHandler(this); // Register ourselves as a handler for scan results.
        mScannerView.startCamera();         // Start camera

    }
 
开发者ID:smartlockpicking,项目名称:hackmelock-android,代码行数:10,代码来源:QRCodeActivity.java


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