MultiContactPicker
MultiContactPicker copied to clipboard
Didn't Work in fragment
onActivityResult() doesn't get called in fragment after selecting contacts.
@pareekrohit did you find any solutions. I am getting the same issue.
Any solutions for fragment.
fragment issue is still there. So you have to get the data from the activity's onActivityResult. It is triggering there. Open the picker in fragment and the get the data on activity where you have implemented fragment and then pass the data to fragment.
This might resolve the issue. In your parent activity
// Kotlin
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
for (fragment in supportFragmentManager.fragments) {
fragment.onActivityResult(requestCode, resultCode, data)
}
}
This might resolve the issue. In your parent activity
// Kotlin override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) for (fragment in supportFragmentManager.fragments) { fragment.onActivityResult(requestCode, resultCode, data) } }
Fragment.onActivityResult()
is deprecated as of 2022. There is a replacement for onActivityResult()
but it depends on Dialog
class, which this doesn't extend.