Howdy, y'all!
Please forgive my incompetence but I seem to be having an issue properly getting hour and minutes from a TimePicker dialog. I am receiving the following error (which I know has a simple fix staring me in the face):
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.widget.TimePicker.getHour()' on a null object reference
at j5tech.co.offthehook.AddNewActivity$3.onClick(AddNewActivity.java:125)
at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:163)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Error provided, let me also show you the code I am working with:
I have been staring at and tinkering with this issue for a few hours now to no avail, so I figured it is probably time to ask for help. Thanks!