File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "getting null pointer" Watch "getting null pointer" New topic
Author

getting null pointer

sam liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 1073
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: 41155
    
  45
Which object is null?


Ping & DNS - my free Android networking tools app
sam liyanage
Ranch Hand

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

Joined: Mar 22, 2005
Posts: 41155
    
  45
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 liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 1073
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: 41155
    
  45
What does getApplicationContext() return?

What does Toast.makeText(...) return?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getting null pointer
 
Similar Threads
external allocation too large for this process,Error inflating class, bitmap size exceeds VM budget
Android CustomListView getView() getting nullpointerexception
unable to create the service ,it gives null pointer exception
how to add a google search option
is there any way to trigger onLocationChanged other than moving