nullpointerexception

TimePicker NullPointerException on ICS

﹥>﹥吖頭↗ 提交于 2019-12-22 05:31:54
问题 Alright so I just switched my TimePickerDialog to a TimePicker widget directly visible in the Activity I'm working on because of customer demand. The problem is when I press any of the arrows on said TimePicker , I get a NullPointerException. Just to clarify, no code what so ever is attached to the TimePicker except this line in the onCreate() method of my Activity: ((TimePicker) findViewById(R.id.time_picker)).setIs24HourView(true); I found this post on the Google Forums regarding this issue

TimePicker NullPointerException on ICS

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 05:31:09
问题 Alright so I just switched my TimePickerDialog to a TimePicker widget directly visible in the Activity I'm working on because of customer demand. The problem is when I press any of the arrows on said TimePicker , I get a NullPointerException. Just to clarify, no code what so ever is attached to the TimePicker except this line in the onCreate() method of my Activity: ((TimePicker) findViewById(R.id.time_picker)).setIs24HourView(true); I found this post on the Google Forums regarding this issue

Difference between getExtras(name).getString and getIntent().getStringExtra(name)

て烟熏妆下的殇ゞ 提交于 2019-12-22 05:01:20
问题 I have some error reports on my Android app, it's a Nullpointerexception in onCreate() in an Activity. The code that fails is getIntent().getExtras().getStringExtra("name"). (Nullpointerexception) That means that getExtras() is null somehow. I am sure that I am setting the intent extra on every place I am creating the intent. I can't recreate it on my emulator on device. I think it happened on my real device (but not while I was debugging) after I tried to open the app again, in the mean time

Null Pointer Exception in JAXB RI ClassFactory

a 夏天 提交于 2019-12-22 04:42:22
问题 Intro My friend and I are working on a JavaFX application that acts as a planner for our school. We have tasks (homework for classes), events, courses and student info. In an attempt to store data persistently on the user's hard drive we are using JAXB. We have annotated our classes and can successfully marshall the Task class in a wrapper. The problem is unmarshalling from the tasks.xml file. Here are the relevant lines of code: Task.java @XmlRootElement public class Task { //constructors /

NullPointerException when creating a new Dialog

时光怂恿深爱的人放手 提交于 2019-12-22 04:11:59
问题 I have a DialogFragment that creates a listview dialog and on a list item click I want to display an alert dialog but when I create the dialog it gives me a NullPointerException with an error that I have never seen before 08-05 11:40:42.315: E/AndroidRuntime(4693): java.lang.NullPointerException 08-05 11:40:42.315: E/AndroidRuntime(4693): at android.app.AlertDialog.resolveDialogTheme(AlertDialog.java:142) 08-05 11:40:42.315: E/AndroidRuntime(4693): at android.app.AlertDialog$Builder.<init>

Choreographer NullPointerException

谁都会走 提交于 2019-12-22 04:08:27
问题 I've been working on an existing codebase for a while and from browsing our crash log service I've noticed an exception that happens pretty frequently, I am not able to reproduce this issue, nor do I have the context for the scenario to try and dig in, as this is a pretty big project it has become increasingly hard to find out the cause of this exception. I have been searching online for similar issues and couldn't find any useful information. If anyone is familiar with this issue, your help

MapFragment causing NullPointerException at getMapAsync(this) method

流过昼夜 提交于 2019-12-22 04:04:31
问题 I have implemented an activity which adds MapFragment at run time. The MapFragment xml has static fragment and I'm trying to get add at run time. Also I found there are some issues in Lollipop adding the map fragment at runtime. Kindly check Issue raised and temporary solution I have also given my codes below, fragment_map.xml <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android

Is it bad style to use NullPointerException to test for null? [closed]

爷,独闯天下 提交于 2019-12-22 03:58:06
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago . I have some code along the following pattern: return a().b().c().d().e(); now since every one of those methods could return null , one would usually test for this: if( (a()!=null) && (a().b() != null) && ....) { return a().b().c().d().e(); } else { return null; } (and maybe

Method invocation highlighed error in Android Studio

谁都会走 提交于 2019-12-22 03:53:15
问题 Im a little bit confused in Android Studio. I didint seen this kind of errors in Eclipse before. Example: FragmentManager fragmentManager = getFragmentManager(); FragmentTransaction tf = fragmentManager.beginTransaction(); Fragment oldFragment = fragmentManager.findFragmentByTag(AddDialogFragment.TAG); this code is working fine, but fragmentManager.beginTransaction(); gets highlighted and says: Method invocation 'fragmentManager.beginTransaction' may produce 'java.lang.NullPointerException'

url.openstream() or urlconnection.getinputstream() raise nullpointerexception on valid URL

混江龙づ霸主 提交于 2019-12-22 01:22:53
问题 For an android application I am trying to change an URL of an XML because of a new server, but the content is the same. I used to do this: InputSource ins = new InputSource(rssUrl.openStream()); This used to work and for a few days still does, while the old URL is available on on the old server. But when i change the URL of the XML I get an NullPointerException on the row above. I am sure rssUrl is not null, I printed the value of it an is just the working URL. I validated the XMl and the XML