Forums Register Login

Fragment not recognised as a fragment

+Pie Number of slices to send: Send
I have an inner class like so

but Line 12 isn't being recognised as a Fragment the exact error message is actually for line 10 which says
1. Multiple markers at this Line
2. the return type is incompatable

I thought that if a class extends Fragment then it would be a fragment so I checked the original class

and Yes it extends Fragment

+Pie Number of slices to send: Send
Are you importing and using the same Fragment class in both places? There's android.app.Fragment and there's android.support.v4.app.Fragment - which are incompatible to one another.
+Pie Number of slices to send: Send
Thanks for that it worked
NOTE TO SELF Do not reference a class that uses import x when the referencing class imports a compatibility version of x
If you were a tree, what sort of tree would you be? This tiny ad is a poop beast.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1260 times.
Similar Threads
Java Multi Dimension array -how to read values from spinners
Dynamic Fragments: How can I access them when they are recreated from saved state?
java.lang.illegalStateException Actionbar Tab must have a callback
Issue so far is 2 days in that, i need reload fragment data after made refresh token using asynctask
MapFragment getMap( ) always returns null;
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 03:39:28.