Android Question ACActionBar is not initialized. Why ?

peacemaker

Expert
Licensed User
Longtime User
B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
main_activity_create (B4A line: 39)
ToolbarHelper.ShowUpIndicator = True 'set to true
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.app.ActionBar.setDisplayHomeAsUpEnabled(boolean)' on a null object reference
    at de.amberhome.objects.appcompat.ACActionBar.setShowUpIndicator(ACActionBar.java:116)
    at peacemaker.test.main._activity_create(main.java:383)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
    at peacemaker.test.main.afterFirstLayout(main.java:102)
    at peacemaker.test.main.access$000(main.java:17)
    at peacemaker.test.main$WaitForLayout.run(main.java:80)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6776)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1518)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)

test project is enclosed.
 

Attachments

  • test.zip
    12 KB · Views: 365

peacemaker

Expert
Licensed User
Longtime User
This code is working ok in another project. But I cannot understand why :/
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
you set checkbox at AppCompat Library Manager List in the ide?
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
i download this AppCompat even and open your project, set checkbox at AppCompat but some error remain for other libs i believe.
ok, if me open your project now its checked by default because the lib is found yet.
myself did not have slidingmenuwrapper.

Snap_2018.02.20_21h33m46s_001_.png
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Oh ! Indeed helped, Thanks, DON !
But why so strange behavior - error due to a property setting...
 
Upvote 0
Top