2010-12-15 95 views

Répondre

6

Pour choisir un fichier:

final int CHOOSE_FILE = 1; 
//... 
Intent chooseFile = new Intent(Intent.ACTION_GET_CONTENT); 
chooseFile.setType("file/*"); 
Intent c = Intent.createChooser(chooseFile, "Choose file"); 
startActivityForResult(c, CHOOSE_FILE); 

Puis dans votre onActivityResult:

if(resultCode == RESULT_OK){ 
    Uri uri = data.getData(); 
    String filePath = uri.getPath(); 
    // here goes the code to upload the file 
} 
+1

Merci .. Je vais essayer l'homme .. –