2013-02-11 5 views
0

Comment pourrais-je appeler une chaîne d'une activité à une autre? Mon code ne fonctionne pas, j'essaie d'obtenir un programme qui peut parcourir les images sur la carte SD de mon téléphone et retourner l'adresse de l'image. Je développe un décodeur QR Code basé sur la bibliothèque zxing.Code QR Décodeur, adresse problème des variables

private void onFileClick(Option o) 
{ 
    //Toast.makeText(this, "File Clicked: "+o.getName(), Toast.LENGTH_SHORT).show(); 
    Toast.makeText(this, "File Clicked: "+o.getPath(), Toast.LENGTH_SHORT).show(); 
    QRDecoder qr = null; 
    str = o.getPath(); 
    qr.setFile(str); 
    Intent intent = new Intent(this, QRDecoder.class); 
    Log.d("filter", str); 
    Log.d("filter", qr.my_url); 
    startActivity(intent); 
} 

Répondre

0

avant d'appeler startActivity intent.putExtra("path", str);

dans onCreate du QRDecoder

String path = getIntent().getStringExtra("path");