Question

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

Was it helpful?

Solution

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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top