• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Cannot identify the problem (java.lang.NullPointerException)

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everyone,

everything was working fine till yesterday, and that out of nowhere appeared following problem. Once the main activity is started there are two buttons which based on the selection initiate new activity. The onClick method checkStats works normally, however method startHappinessMeter (uppon click) results in "Unfortunately, Happy App has stopped":

Main Activity code:





Error which is returned when I press the button:





I checked the line 26 in below provided java file and I cant understand why it guides me to the greatBtn onClick listener?




Help would me much appreciated!

best regards
 
Lovro Bajc
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Found the solution In the OnCreate the setContentView was missing.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic