if(item.getItemId()==R.id.action_refresh){ createWeexInstance(); renderPage(); }else if(item.getItemId()==R.id.action_scan){ IntentIntegrator integrator = new IntentIntegrator(this); integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES); integrator.setPrompt("Scan a barcode"); //integrator.setCameraId(0); // Use a specific camera of the device integrator.setBeepEnabled(true); integrator.setOrientationLocked(false); integrator.setBarcodeImageEnabled(true); integrator.setPrompt(getString(R.string.capture_qrcode_prompt)); integrator.initiateScan(); }else if(item.getItemId()==R.id.home){ finish(); }