I finally found the problem. The scanned codes are not always URL
addresses so the intent didn't know how to handle the code(i think so). So this is the answer:
Intent inte = new Intent(Intent.ACTION_VIEW,
Uri.parse("https://www.google.ro/search?q="+bar));
startActivity(inte);