iPaulPro/aFileChooser — Issue #1: Cannot receive result from started FileChooser activity
Author: cowbaby
Created: 2012-02-19 18:12:44+00:00
State: open

Hi Paul,

Firstly, thanks for your effort in making this FileChooser which is really neat.

However, following the way from your Readme and code from example, I have encountered problems in getting

intent result from the FilePicker which is my version of activity extends the FileChooser.

Heres the codes:

=====================================

I starts the activity by:

Intent in = new Intent(v.getContext(),
org.vc.FilePicker.FilePicker.class);
in.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(in, REQUEST_CODE);

OnActivityResult:

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK)
if (requestCode == REQUEST_CODE) {
if (data.hasExtra("tmp")) {
String tmp = data.getStringExtra("tmp");
Toast.makeText(this, "filename: " + tmp, Toast.LENGTH_LONG).show();
Log.i("Filename:", tmp);
}
}
}

=======================================

In the newly created FilePicker Activity:

@Override
public void finish() {
Intent data = new Intent();
Log.i("&&&&&&&&&& PATH", tmp);
data.putExtra("tmp", tmp);
setResult(RESULT_OK, data);
super.finish();
}

=======================================

This setting turns out to be no result could be fetched by the

main Activity although the FilePicker works perfectly on picking files.

PS: for some reason, my testing Log.i(); outputs never triggers or could not be found in

logcat neither.

Thanks in advance, looking forward for you reply.