Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Android and the fly likes nullpointer when i try to initiate onclicklistener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "nullpointer when i try to initiate onclicklistener" Watch "nullpointer when i try to initiate onclicklistener" New topic
Author

nullpointer when i try to initiate onclicklistener

ian myers
Greenhorn

Joined: Apr 11, 2011
Posts: 7
here is the code



here is the xml



the problem is line 18 but I dont know why im getting null pointer exceptions
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

show the logcat errors.


Life is easy because we write the source code.....
zoheb hassan
Ranch Hand

Joined: Apr 01, 2009
Posts: 150

There is absolutely no problem with the button clicks here or the code, the problem might be with your WordData class
ian myers
Greenhorn

Joined: Apr 11, 2011
Posts: 7
found the problem. there was something wrong with the emulator, I made a new one and it works, but whenever it runs on the old one it just force closes weird
zoheb hassan
Ranch Hand

Joined: Apr 01, 2009
Posts: 150

Yeah there are instances of even weirder behaviour
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: nullpointer when i try to initiate onclicklistener
 
Similar Threads
How to retrieve string from EditText?
regarding layout
Keyboard events for EditText not reaching my event handler.
how to get a longitude & latitude from a given address
Layouts, bottom position