Boa tarde amigos,
Preciso fazer várias leituras de QRCODE. Estou utilizando a lib Zxing para fazer isso, porém o mesmo só efetua uma leitura por vez.
A princípio criei uma Activity X que chama o leitor de código QRCode
intent = new Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("com.google.zxing.client.android.SCAN.SCAN_MODE",
"QR_CODE_MODE");
startActivityForResult(intent, 0);
Ao ler o código QRCode, o mesmo retorna para esta Activity X com o dado lido, porém eu quero ler mais códigos, portanto no onActivityResult eu faço o tratamento para ver se o usuário clicou para voltar durante a leitura. Só assim eu saberei que ele terminou a leitura.
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == 0) {
if (resultCode == RESULT_OK) {
// contents contains whatever the code was
String contents = intent.getStringExtra("SCAN_RESULT");
// Format contains the type of code i.e. UPC, EAN, QRCode etc...
// String format = intent.getStringExtra("SCAN_RESULT_FORMAT");
// Handle successful scan. In this example add contents to
// ArrayList
if (!results.contains(contents))
results.add(contents);
startActivityForResult(intent, 0);
} else if (resultCode == RESULT_CANCELED) {
qrcode = true;
}
}
}
O Problema é que ao retornar para a Activity, em aparelhos de baixa performance é possível ver a transição de telas e gostaria que não tivesse essa transição.
Existe alguma forma de contornar isso sem ter que mexer no carregamento do layout ?
Obrigado
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.







0 comentários:
Postar um comentário