Android Question [Solved] Error removing title in [B4X] B4XPages + B4XDrawer example

AnandGupta

Expert
Licensed User
Longtime User
I want to make my own custom title bar (with icons, text, color etc.) and I need to have drawer.
I have already done it in multi activity logic. Now trying same in B4XPages.

I found
and

So I removed title from B4XPages example "[B4X] B4XPages + B4XDrawer" example

But it is giving error,
B4X:
Logger connected to: 2360e066
--------- beginning of crash
--------- beginning of system
--------- beginning of main
Copying updated assets files (13)
*** Service (starter) Create ***
** Service (starter) Start **~i:** Activity (main) Create, isFirst = true **
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.~i:** Activity (main) Resume **
Error occurred on line: 15 (B4XPages)
java.lang.RuntimeException: Object should first be initialized (JavaObject).
    at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
    at anywheresoftware.b4j.object.JavaObject.getCurrentClass(JavaObject.java:259)
    at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:119)
    at b4a.example.b4xpage2$ResumableSub_B4XPage_Appear.resume(b4xpage2.java:105)
    at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:48)
    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:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
    at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:43)
    at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1704)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5235)
    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:898)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
** Activity (main) Pause event (activity is not paused). **

Libraries shows latest

b4a2.png

Need help here.

Regards,

Anand
 

AnandGupta

Expert
Licensed User
Longtime User
Can you post the code in B4XPage2.B4XPage_Appear ?
Yes.

B4X:
Private Sub B4XPage_Appear
    lblHello.Text = $"Hello ${B4XPages.MainPage.txtUser.Text}!"$
    UpdateImage
    #if B4A
    Sleep(0)
    B4XPages.GetManager.ActionBar.RunMethod("setDisplayHomeAsUpEnabled", Array(True))
    Dim bd As BitmapDrawable
    bd.Initialize(HamburgerIcon)
    B4XPages.GetManager.ActionBar.RunMethod("setHomeAsUpIndicator", Array(bd))
    #End If
End Sub

Regards,

Anand
 
Upvote 0
Top