Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private int VALOR_RETORNO = 1;
- ....
- Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
- intent.setType("*/*");
- startActivityForResult(Intent.createChooser(intent, "Choose File"), VALOR_RETORNO);
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- if (resultCode == RESULT_CANCELED) {
- //Cancelado por el usuario
- }
- if ((resultCode == RESULT_OK) && (requestCode == VALOR_RETORNO )) {
- //Procesar el resultado
- Uri uri = data.getData(); //obtener el uri content
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement