I have this app which consists of three tabs. The first tab has a button to scan QRcode. I didn’t use an intent to call the barcode scanner here. I integrated all com.google… into my src. It works smoothly. The issue here, is when I scan for a Qrcode that has a website. The result I get back is the URL itself because of the textView. How do I get this URL to be clickable and redirected to the browser? Or simply show the content of the website in my app. Here is the Result Activity:
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode != RESULT_OK) {
return;
}
if (requestCode == ACTIVITY_REQUEST_CODE_QRCODE) {
if (txtQRcodeResult == null) {
txtQRcodeResult = (TextView) findViewById(R.id.textView1);
}
txtQRcodeResult.setText(data.getStringExtra("SCAN_RESULT"));
}
}
If you want the user to have to click you can use Linkify:
if you want to just jump into the browser and load the page, you can fire an intent: