本文整理汇总了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));
}
示例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();
}
示例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);
}
示例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);
}
示例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
}
示例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
}
示例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();
}
示例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");
}
示例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();
}
示例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
}