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

error while converting from 1.3.3 to 1.3.6 #277

Closed
rmnbhl opened this issue Jun 7, 2016 · 5 comments
Closed

error while converting from 1.3.3 to 1.3.6 #277

rmnbhl opened this issue Jun 7, 2016 · 5 comments
Labels

Comments

@rmnbhl
Copy link

rmnbhl commented Jun 7, 2016

Hello, I am getting this error after I update the library:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.goodrequest.festivaly, PID: 20948
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.ViewGroup.getChildCount()' on a null object reference
at com.roughike.bottombar.BottomBar.updateTitleBottomPadding(BottomBar.java:1369)
at com.roughike.bottombar.BottomBar.onLayout(BottomBar.java:1358)
at android.view.View.layout(View.java:16761)
at android.view.ViewGroup.layout(ViewGroup.java:5333)
at android.support.design.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.java:1091)
at android.support.design.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.java:801)
at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:815)
at android.view.View.layout(View.java:16761)
at android.view.ViewGroup.layout(ViewGroup.java:5333)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)
at android.widget.FrameLayout.onLayout(FrameLayout.java:508)
at android.view.View.layout(View.java:16761)
at android.view.ViewGroup.layout(ViewGroup.java:5333)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1702)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1556)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1465)
at android.view.View.layout(View.java:16761)
at android.view.ViewGroup.layout(ViewGroup.java:5333)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)
at android.widget.FrameLayout.onLayout(FrameLayout.java:508)
at android.view.View.layout(View.java:16761)
at android.view.ViewGroup.layout(ViewGroup.java:5333)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1702)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1556)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1465)
at android.view.View.layout(View.java:16761)
at android.view.ViewGroup.layout(ViewGroup.java:5333)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)
at android.widget.FrameLayout.onLayout(FrameLayout.java:508)
at android.view.View.layout(View.java:16761)
at android.view.ViewGroup.layout(ViewGroup.java:5333)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2381)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2090)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1239)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6752)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)
at android.view.Choreographer.doCallbacks(Choreographer.java:590)
at android.view.Choreographer.doFrame(Choreographer.java:560)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
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:6145)
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)

I just changed this code:

mBottomBar = BottomBar.attachShy((CoordinatorLayout) findViewById(R.id.bottom_coordinator),
findViewById(R.id.nested_scroll), savedInstanceState);
mBottomBar.noTopOffset();
mBottomBar.noTabletGoodness();
mBottomBar.noNavBarGoodness();
mBottomBar.setItemsFromMenu(R.menu.bottom_tabs, new OnMenuTabClickListener() {
@OverRide
public void onMenuTabSelected(@idres int menuItemId) {
temp = (ViewGroup) findViewById(R.id.main_view);
...

to this:

...
mBottomBar.setItems(R.menu.bottom_tabs);
mBottomBar.setOnMenuTabClickListener(new OnMenuTabClickListener() {
@OverRide
public void onMenuTabSelected(@idres int menuItemId) {
temp = (ViewGroup) findViewById(R.id.main_view);
...

I thought that this is all I supposed to do, any help is greatly appreciate. Thanks

@roughike
Copy link
Owner

roughike commented Jun 7, 2016

Will fix. Thanks.

@roughike roughike added the bug label Jun 7, 2016
@mag2007
Copy link

mag2007 commented Jun 7, 2016

Same thing happens to me on this line:

mBottomBar = BottomBar.attachShy((CoordinatorLayout) findViewById(R.id.coordinatorLayoutMain), findViewById(R.id.myScrollingContent), savedInstanceState);

if i comment this line, app stops crashing, maybe it will help you. Version 1.3.6

@roughike
Copy link
Owner

roughike commented Jun 7, 2016

I couldn't replicate the issue, but @rmnbhl and @mag2007, can you test if it still exists in version 1.3.7?

@mag2007
Copy link

mag2007 commented Jun 7, 2016

@roughike it does not crash any more. Thanks! But the bottombar does not hides either. I will look, maybe i missed something.

@rmnbhl
Copy link
Author

rmnbhl commented Jun 7, 2016

It works well now, also no problem with hiding. Thanks!

@roughike roughike closed this as completed Jun 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants