jeudi 7 mai 2015

problems with intent.getStringExtra ("SCAN_RESUT"); of zxing when I try to get the result of reading the QR code

he scan is successful, the problem is that I do not return me the result, but returns null when I try to display it in a TextView. To be exact, after scans, the result is such that copy like "copy and paste", meaning that the only way to show that I have to push on a EditText and then press "paste". What I want is to print in the TextView where the string is supposed to be saved. In the case of "String format = intent.getStringExtra (" SCAN_RESULT_FORMAT ");" if you show me the contents of String format without problem.

My method here specified:

public void onActivityResult (int requestCode, int resultCode, Intent     intent){
    String contenido = null;
    super.onActivityResult(requestCode, resultCode, intent);
    if (requestCode == 0){
        if (resultCode == RESULT_OK){
            contenido = intent.getStringExtra("SCAN_RESUT");
            String formato =           intent.getStringExtra("SCAN_RESULT_FORMAT");
            //hacer algo con los datos obtenidos

            tv_resulleer.setText("resultado: " + contenido);
            tv_resulcrear.setText("FORMATO: " + formato);


        }
        else
            if (resultCode == RESULT_CANCELED){
                //si se cancelo la captura
                  Toast.makeText(getApplicationContext(), "Cancelado", Toast.LENGTH_SHORT).show();
        }
    }
}

Aucun commentaire:

Enregistrer un commentaire