fragmentmanager

PreferenceFragments not in the same FragmentManager?

萝らか妹 提交于 2021-02-11 07:49:07
问题 We have a PreferenceFragmentCompat , and with a tap on a preference, we want to switch from the current PreferenceFragmentCompat to a new PreferenceFragmentCompat . (To have certain settings on a new screen). However, regardless of what we have tried, we keep running into the following error: Fragment declared target fragment that does not belong to this FragmentManager MainActivity.kt class MainActivity : AppCompatActivity(), ActivityCompat.OnRequestPermissionsResultCallback,

PreferenceFragments not in the same FragmentManager?

风格不统一 提交于 2021-02-11 07:48:57
问题 We have a PreferenceFragmentCompat , and with a tap on a preference, we want to switch from the current PreferenceFragmentCompat to a new PreferenceFragmentCompat . (To have certain settings on a new screen). However, regardless of what we have tried, we keep running into the following error: Fragment declared target fragment that does not belong to this FragmentManager MainActivity.kt class MainActivity : AppCompatActivity(), ActivityCompat.OnRequestPermissionsResultCallback,

Previous fragment is restarting when we go back to previous fragment using backstack in android

瘦欲@ 提交于 2021-01-29 10:09:15
问题 lets say we have two fragment and we are in second fragment then if someone press back button then we successfully go back to the previous fragment (i.e. first fragment) using backstack but the problem is that the previous fragment is restarting everything. I want to display content of previous fragment without any restarting or initializing when we press back button.Thanks in advance. 回答1: Welcome to Android Fragment Life !! As suggested by @Uuu Uuu, you need to use add() method while adding

Proper use of sub sub fragments with (Child)FragmentManager

寵の児 提交于 2020-04-08 00:04:49
问题 How do I properly use Fragments in Fragments? My (simplified) use case is following, I have an activity with a layout fragment and this fragment theirself contains a sub fragment... all fragments are added manually to their parents... ---------------------------------------------------------- - Activity - - - - - - --------------------------------------- - - - Fragment - - - - - - - - ----------------- - - - - - SubFragment - - - - - - - - - - - - - - - - - ----------------- - - - -----------

Proper use of sub sub fragments with (Child)FragmentManager

二次信任 提交于 2020-04-08 00:03:05
问题 How do I properly use Fragments in Fragments? My (simplified) use case is following, I have an activity with a layout fragment and this fragment theirself contains a sub fragment... all fragments are added manually to their parents... ---------------------------------------------------------- - Activity - - - - - - --------------------------------------- - - - Fragment - - - - - - - - ----------------- - - - - - SubFragment - - - - - - - - - - - - - - - - - ----------------- - - - -----------