• 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
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Help with null pointer exception

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm using Robotium and Proguard. yet the following keeps generating a null pointer reference. Any help would be greatly appreciated.



Thanks
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you assigned any value to the solo variable? You show yourself defining the variable, but I don't see anything that assigns a value to it.
 
Demetreaus Coleman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes,

It's defined in the setup method.



Thanks

 
Steve Luke
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And can you trace that that setup method happens before inboxExists() method? And that it happens on the same instance of (whatever class) you are working on?

One of the most confusing things for me is the auto-loading of Fragments, especially after state changes (such as switches from portrait to landscape and back). The FragmentManager often saves Fragment states before such changes, then after the change creates new fragments automatically, then loads them back in as the Activity which uses them is created. Then I create the Fragment in the Activity, assign values and make sure it is initialized, and finally display it. But the one that I initialized ends up not being the one that makes it to screen, the one the FragmentManager creates does. So any classes and data assigned or inited from method calls in the Activity or outside the normal creation workflow of the Fragment would not be done on the Fragment which is actually used.

See this post for a relatively simple solution if you think this is your problem.
 
Demetreaus Coleman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Steve,

Will try this after work and thanks for all your help.
 
I just had the craziest dream. This tiny ad was in it.
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic