Why this error ?
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
main_activity_create (java line: 355)
java.lang.ClassCastException: b4a.example.main cannot be cast to androidx.appcompat.app.AppCompatActivity
at de.amberhome.objects.appcompat.ACActionBar.Initialize(ACActionBar.java:29)
at b4a.example.main._activity_create(main.java:355)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at b4a.example.main.afterFirstLayout(main.java:104)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
code
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
main_activity_create (java line: 355)
java.lang.ClassCastException: b4a.example.main cannot be cast to androidx.appcompat.app.AppCompatActivity
at de.amberhome.objects.appcompat.ACActionBar.Initialize(ACActionBar.java:29)
at b4a.example.main._activity_create(main.java:355)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at b4a.example.main.afterFirstLayout(main.java:104)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
code
B4X:
Sub Process_Globals
Private cartBitmap As Bitmap
End Sub
Sub Globals
Private ToolbarHelper As ACActionBar
Private ACToolBL1 As ACToolBarLight
Private CLV1 As CustomListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
If FirstTime Then
cartBitmap = LoadBitmap(File.DirAssets, "menu.png")
End If
ToolbarHelper.Initialize
ToolbarHelper.ShowUpIndicator = True 'set to true to show the up arrow
ToolbarHelper.UpIndicatorDrawable = BitmapToBitmapDrawable(LoadBitmap(File.DirAssets, "cart.png"))
ACToolBL1.InitMenuListener
'.........'