nullpointerexception

Why am I getting a crash when exiting my Activity?

蓝咒 提交于 2019-12-18 07:44:49
问题 I am experiencing a crash in my app when I quit (via the back button) out of my Activity. So far as I can tell this is happening in the Android codebase and not mine, but I'm not completely convinced of that. Here's the stacktrace from adb: AndroidRuntime E Uncaught handler: thread main exiting due to uncaught exception AndroidRuntime E java.lang.RuntimeException: Unable to stop activity {MyApp/MyApp.MainActivity}: java.lang.NullPointerException AndroidRuntime E at android.app.ActivityThread

Why am I getting a crash when exiting my Activity?

依然范特西╮ 提交于 2019-12-18 07:44:33
问题 I am experiencing a crash in my app when I quit (via the back button) out of my Activity. So far as I can tell this is happening in the Android codebase and not mine, but I'm not completely convinced of that. Here's the stacktrace from adb: AndroidRuntime E Uncaught handler: thread main exiting due to uncaught exception AndroidRuntime E java.lang.RuntimeException: Unable to stop activity {MyApp/MyApp.MainActivity}: java.lang.NullPointerException AndroidRuntime E at android.app.ActivityThread

JavaFX - getScene() returns null

独自空忆成欢 提交于 2019-12-18 07:33:45
问题 I just started using JavaFX Scene Builder to build a small application. It is made up of a controller class 'Login.java' which belongs to 'login.fxml', in which the FXML file 'registrierung.fxml' is loaded via a method called 'registrationClicked(ActionEvent event)': public class Login { @FXML private void registrationClicked(ActionEvent event){ try{ ((Node) (event.getSource())).getScene().getWindow().hide(); FXMLLoader loader = new FXMLLoader(getClass().getResource("/view/fxml/registrierung

JsonMappingException (was java.lang.NullPointerException)

心不动则不痛 提交于 2019-12-18 05:58:06
问题 I've been searching for this for a while but haven't found any answers, so either I'm missing something so obvious noone has written anything about it, or I've hit an unusual problem. I'm hoping it's the first... I'm working with a third-party library (IDMLlib) to extract information from an Adobe InDesign document stored in the .idml format. The contents are easily read and stored in an object of type "Idml", which contains everything I need. Now, I want to send this object to a web client

NullPointerException when using CustomListAdapter

情到浓时终转凉″ 提交于 2019-12-18 05:14:07
问题 I create CustomListAdapter in Android Appiclation. But i get this error NullPointerException when implement it. Here is my CustomListAdapter.java code : /** * */ package com.fanjavaid.searchhttprequest.adapter; import java.util.List; import com.android.volley.toolbox.ImageLoader; import com.android.volley.toolbox.NetworkImageView; import com.fanjavaid.searchhttprequest.R; import com.fanjavaid.searchhttprequest.app.AppController; import com.fanjavaid.searchhttprequest.model.Menu; import

Android NullPointerException - Spinner onItemSelected `view` parameter is null after rotating

拈花ヽ惹草 提交于 2019-12-18 04:55:21
问题 Note: A limiting workaround from another, similar SO question's answer worked for me, but I am interested in finding a true solution. The workaround was to add this to my Activity: @Override protected void onSaveInstanceState(Bundle outState) { /* do nothing */ } But I would still like to leave this question open in hopes for finding a better solution. My app crashes when it rotates on the latest Android (Marshmallow, Lollipop), but it works on KitKat. In the Spinner onClick method, I get the

Why does my icon handling code throw a NullPointerException?

≡放荡痞女 提交于 2019-12-18 04:23:13
问题 I have added an image for my button,but when I run that frame this exception will be thrown .why?please help me. init: deps-jar: compile-single: run-single: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.ImageIcon.<init>(ImageIcon.java:138) at ClientGUI.IdAndPasswordFrame.initComponents(IdAndPasswordFrame.java:91) at ClientGUI.IdAndPasswordFrame.<init>(IdAndPasswordFrame.java:22) at ClientGUI.IdAndPasswordFrame$4.run(IdAndPasswordFrame.java:200) at java

PreferenceFragment.findPreference always returns NULL

时光总嘲笑我的痴心妄想 提交于 2019-12-18 04:03:29
问题 I'm currently trying to make a settings menu, that will show a MultiSelectListPreference , to select multiple contacts from your contact list. At this moment, I'm receiving an NullPointerException , when i try to MultiSelectListPreference#setEntryValue(CharSequence[]) If I put the setEntries first, that one throws the same exception. I've put a breakpoint, to see step by step what happens. The variables are filled because they store Strings , they can contain a String "null", so I guess that

PreferenceFragment.findPreference always returns NULL

醉酒当歌 提交于 2019-12-18 04:03:01
问题 I'm currently trying to make a settings menu, that will show a MultiSelectListPreference , to select multiple contacts from your contact list. At this moment, I'm receiving an NullPointerException , when i try to MultiSelectListPreference#setEntryValue(CharSequence[]) If I put the setEntries first, that one throws the same exception. I've put a breakpoint, to see step by step what happens. The variables are filled because they store Strings , they can contain a String "null", so I guess that

How do I get @ParametersAreNonnullByDefault to work?

本秂侑毒 提交于 2019-12-18 03:07:05
问题 I've made several attempts at getting package annotation @ParametersAreNonnullByDefault to work for me in a maven project but with no success. Could someone share a link to a minimal/sample maven project where this is setup (or post the pom.xml and package-info.java and demo class)? I'm talking about having findbugs processor enforce it for me. 回答1: How to apply @ParametersAreNonnullByDefault Create a file package-info.java in your package where you want to enforce the desired behavior. In