Hi
I am trying to run this code snippet to get a list of saved wifis:
Sub Activity_Resume
Log("Activity_Resume called")
Dim myAPlist As List
myAPlist.Initialize
myAPlist = myScan.listSavedNetworks
Log(myAPlist)
End Sub
but I am getting the error
Process_Globals called
*** Service (starter) Create ***
** Service (starter) Start **
Globals called
** Activity (main) Create, isFirst = true **
Activity_Create completed
** Activity (main) Resume **
Activity_Resume called
Error occurred on line: 198 (Main)
java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
at wifi.MLwifi$MLWifiScanner.listSavedNetworks(MLwifi.java:997)
at com.msluk.net.siot_approach_data.main._activity_resume(main.java:542)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
at com.msluk.net.siot_approach_data.main.afterFirstLayout(main.java:108)
at com.msluk.net.siot_approach_data.main.access$000(main.java:17)
at com.msluk.net.siot_approach_data.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6934)
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:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy **
SENTINEL_MSG_LIBCUTILS
SENTINEL_MSG_LIBLOG
I ran a very similar code snippet yesterday and it worked, but I modified it and started getting this error so I extracted these lines to make things simpler.
Thanks
Simon M
I am trying to run this code snippet to get a list of saved wifis:
Sub Activity_Resume
Log("Activity_Resume called")
Dim myAPlist As List
myAPlist.Initialize
myAPlist = myScan.listSavedNetworks
Log(myAPlist)
End Sub
but I am getting the error
Process_Globals called
*** Service (starter) Create ***
** Service (starter) Start **
Globals called
** Activity (main) Create, isFirst = true **
Activity_Create completed
** Activity (main) Resume **
Activity_Resume called
Error occurred on line: 198 (Main)
java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
at wifi.MLwifi$MLWifiScanner.listSavedNetworks(MLwifi.java:997)
at com.msluk.net.siot_approach_data.main._activity_resume(main.java:542)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
at com.msluk.net.siot_approach_data.main.afterFirstLayout(main.java:108)
at com.msluk.net.siot_approach_data.main.access$000(main.java:17)
at com.msluk.net.siot_approach_data.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6934)
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:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy **
SENTINEL_MSG_LIBCUTILS
SENTINEL_MSG_LIBLOG
I ran a very similar code snippet yesterday and it worked, but I modified it and started getting this error so I extracted these lines to make things simpler.
Thanks
Simon M