Stack Exchange
How do I add a redirect after QR code scan
I have the following code in my android qr code scanner how do I change it so it redirects to an URL instead?
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
   if (requestCode == BARCODE_READER_REQUEST_CODE) {
       if (resultCode == CommonStatusCodes.SUCCESS) {
           if (data != null) {
               val barcode = data.getParcelableExtra<Barcode>(BarcodeCaptureActivity.BarcodeObject)
               val p = barcode.cornerPoints
                    mResultTextView.text = barcode.displayValue
            } else
            mResultTextView.setText(R.string.no_barcode_captured)
        } else
        Log.e(LOG_TAG, String.format(getString(R.string.barcode_error_format),
                        CommonStatusCodes.getStatusCodeString(resultCode)))
    } else
        super.onActivityResult(requestCode, resultCode, data)
}


rediret to url in the browser?


Which URL? Whole QR code text is URL? 2) what you mean by redirect?


You get the value inside the QR with: 
 barcode.displayValue

If is an URL and you want to redirect it, what you can do is add this code:
String url = barcode.displayValue;
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(browserIntent);

