use of com.google.zxing.integration.android.IntentResult in project Conversations by siacs.
the class OmemoActivity method onActivityResult.
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
if (scanResult != null && scanResult.getFormatName() != null) {
String data = scanResult.getContents();
XmppUri uri = new XmppUri(data);
if (xmppConnectionServiceBound) {
processFingerprintVerification(uri);
} else {
this.mPendingFingerprintVerificationUri = uri;
}
}
}
use of com.google.zxing.integration.android.IntentResult in project Conversations by siacs.
the class StartConversationActivity method 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;
}
}
} else if (resultCode == RESULT_OK) {
if (xmppConnectionServiceBound) {
this.mPostponedActivityResult = null;
if (requestCode == REQUEST_CREATE_CONFERENCE) {
Account account = extractAccount(intent);
final String subject = intent.getStringExtra("subject");
List<Jid> jids = new ArrayList<>();
if (intent.getBooleanExtra("multiple", false)) {
String[] toAdd = intent.getStringArrayExtra("contacts");
for (String item : toAdd) {
try {
jids.add(Jid.fromString(item));
} catch (InvalidJidException e) {
//ignored
}
}
} else {
try {
jids.add(Jid.fromString(intent.getStringExtra("contact")));
} catch (Exception e) {
//ignored
}
}
if (account != null && jids.size() > 0) {
if (xmppConnectionService.createAdhocConference(account, subject, jids, mAdhocConferenceCallback)) {
mToast = Toast.makeText(this, R.string.creating_conference, Toast.LENGTH_LONG);
mToast.show();
}
}
}
} else {
this.mPostponedActivityResult = new Pair<>(requestCode, intent);
}
}
super.onActivityResult(requestCode, requestCode, intent);
}
use of com.google.zxing.integration.android.IntentResult in project weex-example by KalicyZhou.
the class WXPageActivity method onActivityResult.
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if (result != null) {
if (result.getContents() == null) {
Toast.makeText(this, "Cancelled", Toast.LENGTH_LONG).show();
} else {
handleDecodeInternally(result.getContents());
}
}
super.onActivityResult(requestCode, resultCode, data);
}
Aggregations