Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Fragment not recognised as a fragment

 
Stephen Black
Ranch Hand
Posts: 52
1
Chrome MySQL Database
  • Mark post as helpful
  • send pies
  • 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

 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • 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
Chrome MySQL Database
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic