roboguice/roboguice — pull request #204 by stephanenicolas (2014-06-24 11:02:06+00:00)
Title: Fragment scope. Works and passes all tests.

Work on https://github.com/roboguice/roboguice/issues/146

This implementation provides a fragment scope. The fragment injector is always a child of its activity injector (which is child of the application injector).

For more details on nested fragments, please read below.

---

#### Nested fragments.

It would be very nice if the injector of an inner fragment could be a child injector of its parent's injector.

This looks logical. Nevertheless, it looks like there is no way to know the parent Fragment of a subFragment before API 17.
http://developer.android.com/reference/android/app/Fragment.html#getParentFragment()

I highlight a couple of StackOverFlow questions and answers on this matter :
* [How to get all sub/inner/nested Fragments of a Fragment?](http://stackoverflow.com/q/24315576/693752)
* [Is there a way to get references for all currently active fragments in an Activity?](http://stackoverflow.com/q/6102007/693752)
* [getParentFragment API 16](http://stackoverflow.com/q/20376297/693752)

Please not that there is absolutely no problem to get the parent fragment of a fragment when using latest versions of the support library : http://developer.android.com/reference/android/support/v4/app/Fragment.html#getParentFragment()