如何扫描作为URL的QR码并打开链接

时间:2018-02-24 17:51:42

标签: android qr-code

我有下面的代码,通过扫描qr代码但不显示我希望它打开网址的链接,我该怎么改变这个呢?

@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
        if (result != null) {
            if (result.getContents()==null) {
                Toast.makeText(this, "You cancelled the scanning", Toast.LENGTH_LONG).show();
            }
            else {
                Toast.makeText(this, result.getContents(),Toast.LENGTH_LONG).show();
            }
        }
        else {

            super.onActivityResult(requestCode, resultCode, data);
        }
    }

0 个答案:

没有答案