Android Question MultiPhotoPicker Error

Multiverse app

Active Member
Licensed User
Longtime User
Donmanfred's MultiPhotoPicker Wrap works perfectly in the example but throws this error when imports to my project-

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aapkagarage.garage/com.nileshp.multiphotopicker.photopicker.activity.PickImageActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.app.ActionBar.setDisplayHomeAsUpEnabled(boolean)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2955)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3030)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6938)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.app.ActionBar.setDisplayHomeAsUpEnabled(boolean)' on a null object reference
at com.nileshp.multiphotopicker.photopicker.activity.PickImageActivity.onCreate(PickImageActivity.java:170)
at android.app.Activity.performCreate(Activity.java:7174)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2908)
... 9 more


The error is in the line-
B4X:
mpp.startPickerActivity(50,3)

Any help would be appreciated.
Thank you!
 

DonManfred

Expert
Licensed User
Longtime User
Check the manifest from the example
 
Upvote 0

Multiverse app

Active Member
Licensed User
Longtime User
and you app is using app compat and the theme from the example?
Yes, the app uses Appcompat.

This is how the theme is defined in the Manifest:

B4X:
CreateResource(values, theme.xml,
<resources>
    <style name="MyAppTheme" parent="@style/Theme.AppCompat">
        <item name="colorPrimary">#41BAFF</item>
        <item name="colorPrimaryDark">#3D82F7</item>
        <item name="colorAccent">#ff4081</item>
        <item name="android:statusBarColor">#3D82F7</item>
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>
</resources>
)
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
try to use it with the exact theme as in the example. Just to make sure
Make sure that the activity which is calling the picker also needs to be using
B4X:
#Extends: android.support.v7.app.AppCompatActivity
As you told; the example is working for me too.

Otherwise you need to create a testproject which shoes the issue. But i guess i can´t help if it is related to the Theme you are using.
 
Upvote 0
Top