aspose file tools
The moose likes Android and the fly likes getting null pointer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "getting null pointer" Watch "getting null pointer" New topic
Author

getting null pointer

sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1236
this is my main class


this is online class


when i click the links it gives this error


but whe i print position it gives values.
so how it gives null pointer?
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42952
    
  73
Which object is null?
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1236
I also need to know ?
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42952
    
  73
We are not in a position to figure that out - you are. For example, you can print relevant values to the Log.

Also, in which line does the exception occur, meaning, which one is line 52 - the one labelled 52 in your post?
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1236
It gives null pointer in this line

Toast.makeText(getApplicationContext(), "AAAAAAAAAAAAAAAAAAAAA "+position, Toast.LENGTH_LONG).show();

but the position value is not null.
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42952
    
  73
What does getApplicationContext() return?

What does Toast.makeText(...) return?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getting null pointer