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
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: 1225
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
Marshal

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

Joined: Nov 25, 2008
Posts: 1225
I also need to know ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
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: 1225
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
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
What does getApplicationContext() return?

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