質問

i have been using RoboGuice dependency injection with a Activity and a Fragment Activity. But i cannot figure out how i can use it using a fragment as we dont call setContentview in the Fargment. Can anyone show me an example of how to use this ?

Kind Regards

役に立ちましたか?

解決

Here's a post that describes the solution. Main steps are:

  1. Extend RoboFragment.
  2. Return a root View from onCreateView().
  3. Use @InjectView annotations the same way you do in RoboActivity.
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top