Closed ArnoutCreemers closed 10 years ago
Does your Fragment
extend org.holoeverywhere.app.Fragment
? I don't think so. The problem isn't in the Activity
. It's in your Fragment
.
And please:
My Fragment does extend org.holoeverywhere.app.Fragment while my Activity extends org.holoeverywhere.app.Activity. getSupportFragmentManager().getFragment() will always return an android.support.v4.app.Fragment while I don't need this... I need a org.holoeverywhere.app.Fragment. Am I calling the wrong method or is it a bug..?
I guess I should have posted it on StackOverflow, indeed. I'm sorry for that. But as I couldn't find anything about this I figured it might could be a bug?
No problem, the next time you will report in the right place ;).
If I understand properly you have a compilation problem, not a CastCassException, right? Did you try this?:
Fragment fragment = (Fragment) getActivity().getSupportFragmentManager().getFragment(savedInstanceState, "fragment_top");
Well, that actually does seem to solve the problem. Which is weird because I'm sure I had tried this before and then, it didn't work.. So it's not a bug and just my mistake.
Thanks for your help. This topic may be removed :-)
I've been struggling using fragments with holoeverywhere. I've tried everything. I am trying to do the following:
Fragment fr = getFragmentManager().getFragment(savedInstanceState, "fragment_top");
This gives me the following error: Type mismatch: cannot convert from android.support.v4.app.Fragment to org.holoeverywhere.app.Fragment Which I understand, as 'fr' is an instance of org.holoeverywhere.app.Fragment, and getFragment() gives me an android.support.v4.app.Fragment.
using the following won't work either: Fragment fragment=getActivity().getSupportFragmentManager().getFragment(savedInstanceState, "fragment_top");
But how to use fragments then? I've used the following imports:
import org.holoeverywhere.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction;
There aren't any fragmentManager libraries in HoloEverywhere I understand? Then how would I call getFragmentManager() using holoeverywhere?
I really don't understand.