android - What happens after we replace a Fragment in a Transaction -
i want know
getfragmentmanager() .begintransaction() .replace( r.id.main, fragment.instantiate(loadingscreen.this, "com.myapp.fragments.fragment1", bundle)).commit(); and later on call
getfragmentmanager() .begintransaction() .replace( r.id.main, fragment.instantiate(loadingscreen.this, "com.myapp.fragments.fragment2", bundle)).commit(); what happens fragment1 view ? destroyed automatically, have manage garbage collection on ?
kind regards
according note on android developers:
when remove or replace fragment , add together transaction stack, fragment removed stopped (not destroyed). if user navigates restore fragment, restarts. if not add together transaction stack, fragment destroyed when removed or replaced.
android
No comments:
Post a Comment