onActivityResult method not being called Android

前端 未结 9 1717
误落风尘
误落风尘 2020-12-08 07:58

I am trying to send data from child activity to parent. But somehow, onActivityResult(..) is not getting called. here is code

Parent activity

selecte         


        
相关标签:
9条回答
  • 2020-12-08 08:26

    And intent that used to launch new Avtivity can not be set with flag Intent.FLAG_ACTIVITY_NEW_TASK, because as per android developer documentation :

    This flag can not be used when the caller is requesting a result from the activity being launched.

    0 讨论(0)
  • 2020-12-08 08:28

    Changing my manifest for the calling activity from android:launchMode="singleInstance" to android:launchMode="singleTop" fixed the issue for me.

    0 讨论(0)
  • 2020-12-08 08:35

    Remove OnActivityResult() method in the Main Class, it works perfectly... MainActivity->>>>Fragments

    0 讨论(0)
提交回复
热议问题