nullpointerexception

NullPointerException trying to launch map fragment

喜夏-厌秋 提交于 2020-01-17 01:22:08
问题 This is the first time I have tried to do anything with play services and google maps/places API. I am getting a NPE error when trying to launch the activity. 06-10 09:15:45.704 19942-19942/com.rcd.mypr E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.rcd.mypr, PID: 19942 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.rcd.mypr/com.rcd.mypr.BoxLocator.BoxLocator}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java

invalid null pointer in xstring

巧了我就是萌 提交于 2020-01-16 19:59:06
问题 So I'm almost done with this assignment but now I'm having difficulties again. When I try to draw text from a question class I get invalid null pointer from xstring. I have about 2 hours, so any help would really be appreciated Here's the question class: class Question { public: int col; int row; bool dailyDouble; char* question; char* answer; double value; Question(); Question(int, int, bool, char*, char*); bool checkAnswer(string); Question& operator=(const Question&); }; Question::Question

I got NullPointerException

♀尐吖头ヾ 提交于 2020-01-16 19:20:55
问题 I'm going back to OOP in java. Here I got problem with simple example: class CreateString { private String name; public CreateString(String name) { this.name = name; } String string = new String(name);//AAA } public class Main { public static void main(String[] args) { CreateString myName = new CreateString("tomjas"); } } I got NullPointerException from line denoted as "AAA". When I change the second line into private String name=""; it's ok. What is wrong with that code? I thought that field

Having trouble getting specific parameter from API response

﹥>﹥吖頭↗ 提交于 2020-01-16 18:52:10
问题 I'm trying to make a simple weather app. I'm using this API for it. on that same page is a list of parameters in the JSON response. I can search for all the parameters and get a response except for the 'weather' parameter. every time I try that I get an java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 3 path $[0] error. I'm not sure what's causing it. here's my code. public class Weather { private String city; private OWM owm = new OWM(

Having trouble getting specific parameter from API response

断了今生、忘了曾经 提交于 2020-01-16 18:51:54
问题 I'm trying to make a simple weather app. I'm using this API for it. on that same page is a list of parameters in the JSON response. I can search for all the parameters and get a response except for the 'weather' parameter. every time I try that I get an java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 3 path $[0] error. I'm not sure what's causing it. here's my code. public class Weather { private String city; private OWM owm = new OWM(

NullPointerExcepter Error when using List Adapter and Custom List View in Android Studio

浪尽此生 提交于 2020-01-16 07:18:05
问题 Been trying to write an app in android studio. Part of the app has to parse a document in JSON and display two TextViews of data for each instance. One being Signal and the other being Noise. I am trying to make a custom list view in case I want to add more detail to each instance. I also would like to make it all contained in a ScrollView. I initially had no problems parsing the document but now that I am trying to implement the ListAdapter I am running into issues. My code is giving me the

Strange NullPointerException in ternary conditional expression [duplicate]

余生长醉 提交于 2020-01-16 05:11:46
问题 This question already has an answer here : Strange Java behaviour. Ternary operator (1 answer) Closed 5 years ago . Can anyone tell me why does Java throw a NullPointerException here? Float x = <some condition> ? myObject.getSomeFloat() : 0.0f; The method getSomeFloat returns Float . Changing 0.0f to new Float(0) works fine. 回答1: The type of this ternary operator is float . Therefore, if myObject.getSomeFloat() returns null, a NullPointerException is thrown when <some condition> is true and

Null pointer exception at action bar

爷,独闯天下 提交于 2020-01-16 01:54:19
问题 I am getting null pointer exception at action bar. I am using getActionBar() .Following are the errors..I am extending Activity java.lang.RuntimeException: Unable to start activity ComponentInfo{com.peoplecloud.guggu/com.peoplecloud.guggu.activity.LandingActivity_}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2211) at android.app.ActivityThread.access$600

How do i resolve NullPointerException when calling methods?

可紊 提交于 2020-01-15 13:33:31
问题 I'm a noob to android and i am having an issue calling a method from another class. The method works works fine when called from within its own class, but i get a nullpointerexception when i call it from another class. Any help would be greatly appreciated. Here is my code; Calling method in class1 from class2: BottlesActivity inst = new BottlesActivity(); inst.call0(); Method in class 1: public void call0() { try { Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri

java.lang.NullPointerException at com.sun.faces.application.view.FaceletViewHandlingStrategy$MethodRetargetHandlerManager

谁都会走 提交于 2020-01-15 12:23:49
问题 I'm using JSF Composite Component for reuse component. However, I keep getting a null-pointer error, I follow some of the tutorial I found but none mention this problem. The stack trace added: java.lang.NullPointerException at com.sun.faces.application.view.FaceletViewHandlingStrategy$MethodRetargetHandlerManager$ArbitraryMethodRegargetHandler.retarget(FaceletViewHandlingStrategy.java:1883) at com.sun.faces.application.view.FaceletViewHandlingStrategy.retargetMethodExpressions