• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Fragment not recognised as a fragment

 
Ranch Hand
Posts: 52
1
MySQL Database Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Stephen Black
Ranch Hand
Posts: 52
1
MySQL Database Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic