0

I am a begginer in Android. I am a PLC programmer, but I would like to write application for my mobile phone. I would like to remote control RGB led via Arduino. But when I make any changes I have the error, and I don't know what is this.

E/AndroidRuntime: FATAL EXCEPTION: main Process: com.led.led, PID: 7790 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.led.led/com.led.led.ledControl}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2412) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2470) at android.app.ActivityThread.access$900(ActivityThread.java:174) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1307) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:146) at android.app.ActivityThread.main(ActivityThread.java:5593) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at com.led.led.ledControl.onCreate(ledControl.java:121) at android.app.Activity.performCreate(Activity.java:5458) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2376) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2470)  at android.app.ActivityThread.access$900(ActivityThread.java:174)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1307)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:146)  at android.app.ActivityThread.main(ActivityThread.java:5593)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)  at dalvik.system.NativeStart.main(Native Method)

halfer
  • 18,701
  • 13
  • 79
  • 158

1 Answers1

0

A NullPointerException occurs when you try to access something not yet defined. Like for eg. trying to setText in a textview before assigning it in the activity with the id in the xml.

Simo
  • 345
  • 4
  • 12