FragmentBackStack | A simple Android application demonstrating the behavior | Android library
kandi X-RAY | FragmentBackStack Summary
kandi X-RAY | FragmentBackStack Summary
A simple Android application demonstrating the behavior of Fragments in a BackStack
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Click the view
- Remove c c
- Removes fragment b
- Removes a fragment
- Called when the BackStack is changed
- Pushes an entry on back stack
- Pop the back stack
- Gets the count of items in the back stack
- Called when the activity is created
- Initialize all views
- Called when an item is clicked
- Set the value of the itemViewHolder onBindViewHolder
- This method is called when the view is created
- Inflates the layout for the fragment
- Inflates the layout for the newly created fragment
FragmentBackStack Key Features
FragmentBackStack Examples and Code Snippets
Community Discussions
Trending Discussions on FragmentBackStack
QUESTION
Hi Xamarin/MvvmCross devs,
I am having a problem with the MvxCachingFragmentCompatActivity, or I think it's a problem. I don't know if it's expected behaviour or not.
In my app I use fragments inside a container view. I'm having a problem with the FragmentBackStack when the activity is being restored after destruction. If I go three levels in from my initial fragment, go into the background and come back to the foreground only the last two views are restored. Note this is with "Don't keep activities" switched on in developer options.
Is there any specific setup/indication I have to give to MvvmCross to indicate too them that I want them to handle my viewmodel save/restore functionality. I don't see any in the samples I went through.
I use to use a manual approach with older versions of MvvmCross where I stored a reference to all my viewmodels in the ContainerViewModel and then just read that up when it's restored. But this doesn't work particularly well when you can have multiple of the same view on the backstack.
I have nothing special in the app, it's base usage of MvxFragment for all the views. I do have a custom presenter, but I only override ShowFragment so I can show popup views instead of replacing. None of the views not being restored uses this functionality, so it's not interfering with anything.
Any help would be grately appreciated. Dane
Update 1
Keep in mind that views in this case are MvxFragments.
while researching this I found some weird backstack behaviour associated with the MvxCachingFragmentActivity. While doing the restore functionality I got fragment tag not found in cache errors, so I added this
...ANSWER
Answered 2017-Mar-31 at 21:10There were two reasons the MvxCachingFragment was not restoring the fragment backstack properly and had the weird navigation issues after coming back from the backgroun.
I did not set
RetainInstance = true;
for the fragments. Since I had many I created a base fragment using MvxFragment and set Retain Instance true in the constructor.I did not have MvvmCross-Json-Plugin installed. Which is used for deserializing the stored viewmodel information from the Bundle.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install FragmentBackStack
You can use FragmentBackStack like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the FragmentBackStack component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page