Android onActivityResult not called / triggered

后端 未结 8 2407
醉梦人生
醉梦人生 2020-12-05 04:41

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

相关标签:
8条回答
  • 2020-12-05 05:13

    Had the same problem. check your manifest and make sure you are NOT using single instance:

    android:launchMode="singleInstance"
    
    0 讨论(0)
  • 2020-12-05 05:13

    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);
    
    0 讨论(0)
提交回复
热议问题