I got this error after trying to use SpaceNavigation lib and add appcompatActivity, also the SDK manager install some things after adding those libs. But now I got this error when calling this code, before it worked well. Maybe the actionbar can not be used with the SpaceNavigation bar?
This is the LOG
Registo conectado a: HUAWEI DRA-LX3
--------- beginning of crash
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
25
%
A
Santa Clara Catholic College,asuncion
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Activity (menu_principal) Create, isFirst = true **
Error occurred on line: 0 (menu_principal)
java.lang.RuntimeException: Object should first be initialized (JavaObject).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4j.object.JavaObject.getCurrentClass(JavaObject.java:258)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:118)
at com.anzoategui.enviapycliente.menu_principal._setactionbarcolor(menu_principal.java:397)
at com.anzoategui.enviapycliente.menu_principal._activity_create(menu_principal.java:370)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:738)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:360)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:260)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at com.anzoategui.enviapycliente.menu_principal.afterFirstLayout(menu_principal.java:104)
at com.anzoategui.enviapycliente.menu_principal.access$000(menu_principal.java:17)
at com.anzoategui.enviapycliente.menu_principal$WaitForLayout.run(menu_principal.java:82)
at android.os.Handler.handleCallback(Handler.java:795)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:6861)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:450)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
** Activity (menu_principal) Resume **
B4X:
Sub SetActionBarColor(Color As Int)
Dim jo As JavaObject
jo.InitializeContext
Dim cd As ColorDrawable
cd.Initialize(Color, 0)
jo.RunMethodJO("getActionBar", Null).RunMethod("setBackgroundDrawable", Array(cd))
This is the LOG
Registo conectado a: HUAWEI DRA-LX3
--------- beginning of crash
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
25
%
A
Santa Clara Catholic College,asuncion
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Activity (menu_principal) Create, isFirst = true **
Error occurred on line: 0 (menu_principal)
java.lang.RuntimeException: Object should first be initialized (JavaObject).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4j.object.JavaObject.getCurrentClass(JavaObject.java:258)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:118)
at com.anzoategui.enviapycliente.menu_principal._setactionbarcolor(menu_principal.java:397)
at com.anzoategui.enviapycliente.menu_principal._activity_create(menu_principal.java:370)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:738)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:360)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:260)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at com.anzoategui.enviapycliente.menu_principal.afterFirstLayout(menu_principal.java:104)
at com.anzoategui.enviapycliente.menu_principal.access$000(menu_principal.java:17)
at com.anzoategui.enviapycliente.menu_principal$WaitForLayout.run(menu_principal.java:82)
at android.os.Handler.handleCallback(Handler.java:795)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:6861)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:450)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
** Activity (menu_principal) Resume **