本文整理汇总了Java中com.google.zxing.integration.android.IntentIntegrator.REQUEST_CODE属性的典型用法代码示例。如果您正苦于以下问题:Java IntentIntegrator.REQUEST_CODE属性的具体用法?Java IntentIntegrator.REQUEST_CODE怎么用?Java IntentIntegrator.REQUEST_CODE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.zxing.integration.android.IntentIntegrator
的用法示例。
在下文中一共展示了IntentIntegrator.REQUEST_CODE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onActivityResult
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
if (requestCode == IntentIntegrator.REQUEST_CODE) {
// 扫描二维码回传值
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
String ewmString = result.getContents();
Intent mintent = new Intent(MainActivity.this, QuickWebLoader.class);
QuickBean bean = new QuickBean(ewmString);
mintent.putExtra("bean", bean);
startActivity(mintent);
}
}
}
示例2: onActivityResult
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if ((requestCode & 0xFFFF) == IntentIntegrator.REQUEST_CODE) {
IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
if (scanResult != null && scanResult.getFormatName() != null) {
String data = scanResult.getContents();
XmppUri uri = new XmppUri(data);
if (xmppConnectionServiceBound) {
verifyWithUri(uri);
finish();
} else {
this.mPendingUri = uri;
}
} else {
finish();
}
}
super.onActivityResult(requestCode, requestCode, intent);
}
示例3: onActivityResult
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if ((requestCode & 0xFFFF) == IntentIntegrator.REQUEST_CODE) {
IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
if (scanResult != null && scanResult.getFormatName() != null) {
String data = scanResult.getContents();
Invite invite = new Invite(data);
if (xmppConnectionServiceBound) {
invite.invite();
} else if (invite.getJid() != null) {
this.mPendingInvite = invite;
} else {
this.mPendingInvite = null;
}
}
}
super.onActivityResult(requestCode, requestCode, intent);
}
示例4: onActivityResult
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == IntentIntegrator.REQUEST_CODE) {
/*
** If result code is OK, it means a QR CODE has been read
** So we have to parse the content and to add an Account into our list
*/
if (resultCode == RESULT_OK) {
OtpURL url = new OtpURL(data.getStringExtra("SCAN_RESULT"));
if (!url.parse()) {
Snackbar.make(findViewById(R.id.content_main), "QR Code invalide", Snackbar.LENGTH_LONG).show();
return;
}
if (!Preferences.get(this).addItem(new ReplicatorItem(url.secret, url.issuer, url.account, url.digits)))
Snackbar.make(findViewById(R.id.content_main), "La clé du compte a été mise à jour", Snackbar.LENGTH_LONG).show();
else
Snackbar.make(findViewById(R.id.content_main), "Compte ajouté", Snackbar.LENGTH_LONG).show();
if (Preferences.get(this).getItems().size() > 0)
txt_no_account.setVisibility(View.INVISIBLE);
adapter.clear();
adapter.addAll(Preferences.get(this).getItems());
adapter.notifyDataSetChanged();
}
}
}
示例5: onActivityResult
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == IntentIntegrator.REQUEST_CODE
&& resultCode == RESULT_OK) {
Bundle extras = data.getExtras();
String commands = extras.getString(
Intents.Scan.RESULT);
JSONObject jsonCommands = null;
try {
jsonCommands = new JSONObject(commands);
if (startOrEnd == 's') {
this.startStation = jsonCommands.getInt("startStation");
((TextView) findViewById(R.id.commandOutTextView)).setText(commands);
} else {
this.endStation = jsonCommands.getInt("endStation");
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}
示例6: onActivityResult
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == Activity.RESULT_OK) {
switch (requestCode) {
case IntentIntegrator.REQUEST_CODE:
onBarcodeResult(requestCode, resultCode, data);
break;
case REQUEST_CODE_EDIT_LOCATION:
onEditLocationResult(data);
break;
}
return;
}
super.onActivityResult(requestCode, resultCode, data);
}
示例7: onActivityResult
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == IntentIntegrator.REQUEST_CODE) {
if (resultCode == RESULT_OK) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
Toast.makeText(this, result.getContents(), Toast.LENGTH_SHORT).show();
String[] parsedTuringData = result.getContents().split(":");
new TestRequestTask().execute(parsedTuringData);
} else if (resultCode == RESULT_CANCELED) {
Toast.makeText(this, "QR Scanning cancelled", Toast.LENGTH_SHORT).show();
}
}
}
示例8: onActivityResult
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if ((requestCode & 0xFFFF) == IntentIntegrator.REQUEST_CODE) {
IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
if (scanResult != null && scanResult.getFormatName() != null) {
String data = scanResult.getContents();
XmppUri uri = new XmppUri(data);
if (xmppConnectionServiceBound) {
verifyWithUri(uri);
finish();
} else {
this.mPendingUri = uri;
}
} else {
finish();
}
}
super.onActivityResult(requestCode, requestCode, intent);
}
示例9: onActivityResult
/**
* Handle Activity Results
* @param requestCode requestCode
* @param resultCode resultCode (RESULT_SETTINGS is defined at the top)
* @param data data
*/
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
//Come back from Settings
case RESULT_SETTINGS:
{
applyPreferenceChanges();
break;
}
// Receive from QR
case IntentIntegrator.REQUEST_CODE:
IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if (scanResult != null) {
String content = scanResult.getContents();
if(content == null) Log.e(APP_ID, "Error! Received nothing from QR-Code!");
else {
Log.d(APP_ID, "Received " + content + " from QR-Code!");
restoreStateFromCode(content);
}
}
}
}
示例10: onActivityResult
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode != Activity.RESULT_OK) {
return;
}
if (requestCode == IntentIntegrator.REQUEST_CODE) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if(result != null) {
if(result.getContents() == null) {
Toast.makeText(this, "扫码取消!", Toast.LENGTH_SHORT).show();
} else {
mInputTextTV.setText(result.getContents());
}
}
}
}
示例11: onActivityResult
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
switch (requestCode & 0xFFFF) {
case IntentIntegrator.REQUEST_CODE: {
IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
if (scanResult != null && scanResult.getFormatName() != null) {
String data = scanResult.getContents();
Log.d(TAG, "data: " + data);
scan.setText(data);
}
break;
}
default: {
super.onActivityResult(requestCode, resultCode, intent);
break;
}
}
}
示例12: onActivityResult
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if(IntentIntegrator.REQUEST_CODE == requestCode && resultCode == Activity.RESULT_OK) {
IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
if (scanResult != null && scanResult.getContents()!=null) {
// Use qrcode string : scanResult.getContents()
ObjCacher.lastQRScanned = scanResult.getContents();
fillImageViewWithQRCode(qrCodeView, scanResult.getContents());
validateAllFactors();
}
}
if(requestCode == CAMREQ_CODE && resultCode == Activity.RESULT_OK) {
Bundle extras = intent.getExtras();
Bitmap picture = (Bitmap) extras.get("data");
ObjCacher.lastFaceBitmapAuth = picture;
faceRecView.setImageBitmap(picture);
validateAllFactors();
}
}
示例13: onActivityResult
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == IntentIntegrator.REQUEST_CODE) {
if (resultCode == RESULT_OK) {
final String contents = data.getStringExtra(Intents.Scan.RESULT);
mInput.postDelayed(new Runnable() {
@Override
public void run() {
mInput.setText(contents);
if (getContext() != null) {
Toast.makeText(getContext(), R.string.decoded, Toast.LENGTH_SHORT).show();
}
}
}, 200);
}
} else if (requestCode == REQUEST_PICK_IMAGE) {
if (resultCode == RESULT_OK) {
if (mDecodeImageTask != null && !mDecodeImageTask.isCancelled()) {
mDecodeImageTask.cancel(true);
}
mDecodeImageTask = new DecodeImageTask(getContext().getApplicationContext(), mInput);
mDecodeImageTask.execute(data.getData());
}
}
}
示例14: onActivityResult
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == IntentIntegrator.REQUEST_CODE) {
// QR scan results came back
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
EditTextPreference pref = (EditTextPreference) findPreference("public_key");
if (pref.getOnPreferenceChangeListener().onPreferenceChange(pref, result.getContents()))
pref.setText(result.getContents());
}
else
((CheckBoxPreference)findPreference(perms.keyAt(requestCode))).setChecked(resultCode == Activity.RESULT_OK);
super.onActivityResult(requestCode, resultCode, data);
}
示例15: onActivityResult
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if ((requestCode & 0xFFFF) == IntentIntegrator.REQUEST_CODE) {
IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode,
intent);
if (scanResult != null && scanResult.getFormatName() != null) {
String data = scanResult.getContents();
handleUri(Uri.parse(data));
}
}
finish();
super.onActivityResult(requestCode, requestCode, intent);
}