• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with null pointer exception

 
Demetreaus Coleman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Yes,

It's defined in the setup method.



Thanks

 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Hello Steve,

Will try this after work and thanks for all your help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic