Top "Nullpointerexception" questions

The Java exception thrown when an application attempts to use null in a case where an object is required.

Android: getContext().getContentResolver() sometimes gets NullPointerException

I want to ask why we get this annotation: Method invocation getContext.getContentResolver() may produce NullPointerException Why is it there …

java android nullpointerexception android-contentresolver
NullPointerException that doesn't point to any line in my code

I am working on a game where the player can drag and drop things around the screen. I've got a …

android layout view nullpointerexception
Why explicitly throw a NullPointerException rather than letting it happen naturally?

When reading JDK source code, I find it common that the author will check the parameters if they are null …

java nullpointerexception
Possible reason for "Error:cannot generate view binders java.lang.NullPointerException"

I am using Android Studio for my Android projects. I faced an issue when builds crash with strange stacktrace, like …

java android data-binding nullpointerexception android-databinding
Android camera capture activity returns null Uri

This code worked on samsung before but now that i'm using Nexus One with Android 2.3.6, it's crashing as soon as …

android nullpointerexception uri android-camera nexus-one
FileProvider.getUriForFile returns NullPointerException

I'm trying to write my first android app, which will involve taking a picture and doing stuff with it. I've …

java android nullpointerexception camera android-fileprovider
label.setText NullPointerException

Hi first time here but here goes: I have a JavaFX application that changes the FXML UI labels dynamically and …

java nullpointerexception javafx fxml settext
MapFragment causing NullPointerException at getMapAsync(this) method

I have implemented an activity which adds MapFragment at run time. The MapFragment xml has static fragment and I'm trying …

android android-fragments nullpointerexception supportmapfragment mapactivity
Why can File.listFiles return null when called on a directory?

I'm creating an Android app, and I want to list the files in a directory. I do this by calling …

java android nullpointerexception file-listing