I want the user to choose a QR reader from his installed apps. This could be done by using the Intent.createChooser. When a picture is taken with the QR reader, the QR code should be sent back to my application. This is what Ive tried so far:
        Intent intent = new Intent(Intent.ACTION_SEND);
            intent.setType("text/plain");
            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
            intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
            String title = (String) getResources().getText(R.string.chooser_title);
            Intent chooser = Intent.createChooser(intent, title);
            startActivityForResult(chooser, CUSTOM_REQUEST_QR_SCANNER);
The scanner doens't start correctly, it only shows an sample QR code. I have a feeling the intent.setType("text/plain") might be wrong? What type is a QR reader? Or how do i start a QR reader this way correctly?
I also have an ActivityResult when the QR app is done:
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
    if (requestCode == CUSTOM_REQUEST_QR_SCANNER) {
        Log.d(TAG, "QR activity complete");
                        //Successful scan
                        if (resultCode == RESULT_OK) {
                Replace
intent.setType("text/plain");
with
intent.setType("com.google.zxing.client.android.SCAN");
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With