johncarl81 / transfuse

:syringe: Transfuse - A Dependency Injection and Integration framework for Google Android
http://androidtransfuse.org/
Apache License 2.0
220 stars 28 forks source link

@NonConfigurationInstance for fragments #115

Open ghost opened 10 years ago

ghost commented 10 years ago

Would it be possible to implement @NonConfigurationInstance for fragments? Currently, no code is generated when you use it in fragments. Since fragments also support onSaveInstanceState, I guess this should be rather easy to implement.

ghost commented 10 years ago

I've looked at the transfuse source code. Found the place where this is implemented for activities. But couldn't find a corresponding place for fragments. In other words, implementing this for fragments is beyond my current capabilities.

johncarl81 commented 10 years ago

You're correct, @NonConfigurationInstance is not implemented for fragments currently. I'm currently refactoring the codebase to make this easier to implement. Stay tuned.

ghost commented 10 years ago

That's good news. For now I've worked around this, so it's not a high priority for me.

johncarl81 commented 10 years ago

@airblaster, Looking at this issue deeper, would http://developer.android.com/reference/android/app/Fragment.html#setRetainInstance(boolean) work for you as an alternative in Fragments?

ghost commented 10 years ago

Not really, but I've solved this problem by integrating IcePick the traditional manual way.