Skip to content

Instantly share code, notes, and snippets.

public void onActivityResult(int requestCode, int resultCode, Intent intent) {
QRIntentOutput scanResult = QRIntegrator.parseActivityResult(requestCode, resultCode, intent);
if (scanResult != null) {
String barcode;
String type;
barcode = scanResult.getContents();
type = scanResult.getFormatName();
public void onClick (View view){
QRIntegrator integrator = new QRIntegrator(this);
integrator.initiateScan();
}
<Button
android:id="@+id/buttonScan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_alignParentTop="true"
android:layout_marginTop="36dp"
android:text="Scan"
android:onClick="onClick"
/>