Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException #48

Closed
joshuaavalon opened this issue Sep 8, 2016 · 5 comments
Closed

NullPointerException #48

joshuaavalon opened this issue Sep 8, 2016 · 5 comments

Comments

@joshuaavalon
Copy link

I am trying to use BoomMenuButton in a fragment.

My XML,

 <com.nightonke.boommenu.BoomMenuButton
    android:id="@+id/boom"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|end"
    android:layout_alignParentBottom="true"
    android:layout_alignParentEnd="true"
    android:layout_margin="@dimen/fab_margin"
    app:boom_button_color="@color/colorPrimary"
    app:boom_button_pressed_color="@color/colorPrimary"
    app:boom_inActionBar="false" />

In onCreateView,

boomMenuButton = (BoomMenuButton) view.findViewById(R.id.boom);

In onWindowFocusChanged,

new BoomMenuButton.Builder()
        .addSubButton(ContextCompat.getDrawable(getContext(), R.drawable.ic_info_outline_white_24dp),
                new int[]{ContextCompat.getColor(getContext(), R.color.white)},
                "BoomMenuButton")
        .addSubButton(ContextCompat.getDrawable(getContext(), R.drawable.ic_info_outline_white_24dp),
                new int[]{ContextCompat.getColor(getContext(), R.color.white)},
                "BoomMenuButton")
        .addSubButton(ContextCompat.getDrawable(getContext(), R.drawable.ic_info_outline_white_24dp),
                new int[]{ContextCompat.getColor(getContext(), R.color.white)},
                "BoomMenuButton")
        .button(ButtonType.HAM)
        .boom(BoomType.PARABOLA)
        .place(PlaceType.HAM_3_1)
        .subButtonTextColor(ContextCompat.getColor(getContext(), R.color.white))
        .init(boomMenuButton);

When I clicked the button, the app crash

java.lang.NullPointerException: Attempt to read from field 'int com.nightonke.boommenu.Types.PlaceType.v' on a null object reference
     at com.nightonke.boommenu.BoomMenuButton.dimAnimationLayout(BoomMenuButton.java:516)
     at com.nightonke.boommenu.BoomMenuButton.shoot(BoomMenuButton.java:467)
     at com.nightonke.boommenu.BoomMenuButton.access$000(BoomMenuButton.java:47)
     at com.nightonke.boommenu.BoomMenuButton$9.onClick(BoomMenuButton.java:1500)
     at android.view.View.performClick(View.java:5197)
     at android.view.View$PerformClick.run(View.java:20926)
     at android.os.Handler.handleCallback(Handler.java:739)
     at android.os.Handler.dispatchMessage(Handler.java:95)
     at android.os.Looper.loop(Looper.java:145)
     at android.app.ActivityThread.main(ActivityThread.java:5951)
     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:1399)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
@ghost
Copy link

ghost commented Sep 20, 2016

same issue :((

@zahansafallwa
Copy link
Contributor

can you specify the line where the error the occur in your code

@joshuaavalon
Copy link
Author

@zahansafallwa As you see in the exception, the NullPointerException is thrown in the library.

@Nightonke
Copy link
Owner

Hey! Now the newest version of BMB was updated. Please use the newest version and let me know whether the bug is fixed.

@gcantoni
Copy link

gcantoni commented Oct 12, 2018

I'm getting NullPointerException too. How did you solve?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants