package chriseldridge.caddy;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.content.Intent;
import android.net.Uri;
import android.widget.Toast;

import com.google.zxing.Result;
import me.dm7.barcodescanner.zxing.ZXingScannerView;

public class MainActivity extends AppCompatActivity implements ZXingScannerView.ResultHandler {
    private ZXingScannerView scannerView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

        scannerView = new ZXingScannerView(this);
        scannerView.setResultHandler(this);
    }

    public void QRScanner(View view) {
        setContentView(scannerView);

        scannerView.startCamera();
    }

    @Override
    public void onPause() {
        super.onPause();

        scannerView.stopCamera();
        setContentView(R.layout.activity_main);
    }
    
    @Override
    public void handleResult(Result rawResult) {
        Toast.makeText(this, rawResult.getText(), Toast.LENGTH_LONG).show();

        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.youtube.com/watch?v=22d-ZjYn8BE&feature=youtu.be")));
    }
}

@@ -1133,125 +1133,375 @@
     
-startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(%22https://www.youtube.com/watch?v=22d-ZjYn8BE&feature=youtu.be%22
+String url = %22%22;%0A%0A        switch(rawResult.getText()) %7B%0A            case %22SeverneBlade%22 :%0A                url = %22https://www.youtube.com/watch?v=NhHaTqiquv4%22;%0A                break;%0A            default :%0A                url = %22https://www.youtube.com/watch?v=22d-ZjYn8BE&feature=youtu.be%22;%0A        %7D%0A%0A        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url
 )));

handle multiple qr codes