For #25505: Clear the stored result in case there is no listener with the same key set.
This is the case when the sharing happens outside the tabs tray.
This commit is contained in:
parent
e01647a7e8
commit
48cb5ec268
|
@ -10,6 +10,7 @@ import android.view.LayoutInflater
|
|||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.app.AppCompatDialogFragment
|
||||
import androidx.fragment.app.clearFragmentResult
|
||||
import androidx.fragment.app.setFragmentResult
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.lifecycle.ViewModelProvider.AndroidViewModelFactory
|
||||
|
@ -128,6 +129,8 @@ class ShareFragment : AppCompatDialogFragment() {
|
|||
|
||||
override fun onDestroy() {
|
||||
setFragmentResult(RESULT_KEY, Bundle())
|
||||
// Clear the stored result in case there is no listener with the same key set.
|
||||
clearFragmentResult(RESULT_KEY)
|
||||
|
||||
super.onDestroy()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user