Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using RoboFragment with FragmentManager

I've been trying to use RoboGuice and fragments with no luck. I have a fragment that extends RoboFragment, and an activity that extends RoboActivity, but it seems that within the RoboActivity, the method getFragmentManager is incompatible with RoboFragment.

It looks like RoboFragment extends android.support.v4.app.Fragmentment but getFragmentManager requires android.app.Fragment.

How is this meant to work?

like image 464
Matt Whetton Avatar asked Feb 17 '13 16:02

Matt Whetton


Video Answer


1 Answers

As always I worked our my problem within 10 minutes of posting (sorry)!

I needed my activity to extend RoboFragmentActivity, which then exposed the getSupportFragmentManager method - which returns the android.support.v4.app.FragmentManager which is obviously compatible with android.support.v4.app.Fragment

Matt

like image 172
Matt Whetton Avatar answered Oct 03 '22 01:10

Matt Whetton