what should happen when I call FragmentTransaction.detach(Fragment
fragment)? Should the Fragment.onDetach() method be called or not?
I have played with this example:
http://developer.android.com/resources/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentTabs.html
At the end of this file you find the "public void onTabChanged(String
tabId)" method with this line "ft.detach(mLastTab.fragment);".
But when this ft.detach is called, the Fragment.onDetach() is not called :-(
Is it right? Or wrong?
I think it is wrong.
The ft.detach method calls "FragmentManager.detachFragment(Fragment
fragment, int transition, int transitionStyle)" (line 1158 @
http://code.google.com/p/openintents/source/browse/trunk/compatibility/AndroidSupportV2/src/android/support/v2/app/FragmentManager.java)
But the FragmentManager sets only a flag that the Fragment was detached
(line 1161). But the fragment was not notified with a method call.
Ralph
--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
But when "ft.detach(mLastTab.fragment);" is called the fragments variable
// Set to true when the app has requested that this fragment be deactivated.
boolean mDetached;
is set to true.
Why is onDetach() not also called? The internal state is mDetached =
true but nobody is notified about this state change.
Ralph
--
Ralph Bergmann
iOS and Android app developer
www http://www.the4thFloor.eu | http://www.dasralph.de
mail ra...@the4thFloor.eu
skype dasralph
xing http://www.xing.com/profile/Ralph_Bergmann3
gulp http://www.gulp.de/Profil/RalphBergmann.html
linkedin http://www.linkedin.com/in/ralphbergmann
java user group http://www.jug-bb.de | http://www.xing.com/net/jugbb
ios dev group http://www.xing.com/net/iosberlin
pgp key id BED003DD883B9A80
pgp fingerprint 7865 EAD3 5834 705B D8B7 AD7C BED0 03DD 883B 9A80
--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.