I have qrReader app so in ActivityResult i wrote to intent into the camera if I have response what I want that is it possible to take the picture automatically after the intent into the camera and after autofocus it ??(what should I have to add for autocapture)
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
IntentIntegrator intentIntegrator = new IntentIntegrator(activity);
intentIntegrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
intentIntegrator.setPrompt("Scan");
intentIntegrator.setCameraId(0);
intentIntegrator.setBeepEnabled(false);
intentIntegrator.setBarcodeImageEnabled(false);
intentIntegrator.initiateScan();
}
});
}
@Override
protected void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
final IntentResult result = IntentIntegrator.parseActivityResult(requestCode,resultCode,data);
if(result!= null){
if(result.getContents()==null){
Toast.makeText(getApplicationContext(),"you canceled the scanning",Toast.LENGTH_LONG).show();
}
else {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
textView.setText(result.getContents());
startActivityForResult(intent, TAKE_PICTURE);
}
}
super.onActivityResult(requestCode, resultCode, data);
}