• Post Reply Bookmark Topic Watch Topic
  • New Topic

error in fragment example  RSS feed

 
sam liya
Ranch Hand
Posts: 1254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is my main activity class



this is my fragmentOne class



this is my FragmentTwo class



below is the exception in logcat



below is the manifest file



i have already define the activities in manifest file.why it gives me above error?
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
sam liya
Ranch Hand
Posts: 1254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so manesh below is my fragment class




it is public ,has no arg constructor and class name exsist.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That tripped me up recently. The need for the empty constructor is documented, but it wasn't obvious to me that the default constructor won't do (although I guess that's not empty due to to the super() call).
 
sam liya
Ranch Hand
Posts: 1254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So ulf what needs to change in above code?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh already quoted what needs to be done. I wish more error messages came with a precise description of how to fix them :-)
 
sam liya
Ranch Hand
Posts: 1254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i change the class as below



then it gives me below error

 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems unrelated. What's the exact connection to your code?
 
Alex Rome
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I fixed this error changing the target in the "project.properties" file with:

target=android-19
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!