I read much about issues with onActivityResult
, but it seems that none of the described problems fit to mine, like putting a negative requestCode in start
Had the same problem. check your manifest and make sure you are NOT using single instance:
android:launchMode="singleInstance"
Another variant on this one. From a DialogFragment, you can startActivityForResult
. But if your Intent is started from the associated Activity, you must include getActivity()
before startActivityForResult
. See below (last line):
Activity activeOne=FileDialogWindow.this.getActivity();
Intent intent = new Intent(activeOne,FolderSelectionActivity.class);
String message = "foobar";
intent.putExtra(EXTRA_MESSAGE, message);
getActivity().startActivityForResult(intent,1);