3
My application worked perfectly with Zxing, after implementing Fragment, the barcode reading stopped working. I tried to configure the return in Fragment, in Activity... but I was unsuccessful. Someone managed to do this implementation?
3
My application worked perfectly with Zxing, after implementing Fragment, the barcode reading stopped working. I tried to configure the return in Fragment, in Activity... but I was unsuccessful. Someone managed to do this implementation?
2
Calling for:
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("SCAN_MODE", "ONE_D_MODE");
startActivityForResult(intent, 0);
Receiving:
public void onActivityResult(int requestCode, int resultCode, Intent intent){
if (requestCode == 0){
if (resultCode == Activity.RESULT_OK) {
String contents = intent.getStringExtra("SCAN_RESULT");
}
else if (resultCode == Activity.RESULT_CANCELED){
Toast.makeText(getActivity(), "Scan unsuccessful", Toast.LENGTH_SHORT).show();
}
}
}
Here works perfectly!
Browser other questions tagged android android-fragment
You are not signed in. Login or sign up in order to post.
Thiago, are you making this call inside the Fragment? What version of Zxing are you using? Vlw for help.
– Seixas
Version: zxing-android-minimal:1.2.1. Exactly, I do inside a Fragment. By clicking a button it called inside an Onclicklistener, which is on an android.app.Fragment
– Thiago Luiz Domacoski
Thiago, I will test and return. Thanks for the help.
– Seixas