java.lang.RuntimeException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Can't handle Toggle Button on Actionbar
    via Stack Overflow by TruongHieu
    ,
    • java.lang.RuntimeException: Unable to start activity ComponentInfo{com.rada.radastaff/com.rada.radastaff.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ToggleButton.setChecked(boolean)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2316) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2376) at android.app.ActivityThread.access$800(ActivityThread.java:147) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1281) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5253) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ToggleButton.setChecked(boolean)' on a null object reference at com.rada.radastaff.MainActivity.onCreate(MainActivity.java:20) at android.app.Activity.performCreate(Activity.java:5975) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2269) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2376) at android.app.ActivityThread.access$800(ActivityThread.java:147) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1281) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5253) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372)
    No Bugmate found.