Skip to content

Bug and Problem in Use this Library. #30

@QuestionPython

Description

@QuestionPython

Hello,
tank you.
i import your lib. and gradle is ready.

but in my layout have problem

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="58dp"
        android:background="@android:color/holo_green_dark"
        android:minHeight="?attr/actionBarSize"
        android:titleTextColor="#ffffff">

    </android.support.v7.widget.Toolbar>


    <Button
        android:id="@+id/btnPayment"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Payment"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"/>


    <com.luseen.luseenbottomnavigation.BottomNavigation.BottomNavigationView
        android:id="@+id/bottomNavigation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true" />

</LinearLayout>

Error show in Android Studio :

java.lang.IndexOutOfBoundsException: Position must be less or equivalent than items size, items size is -1 current is 0   at com.luseen.luseenbottomnavigation.BottomNavigation.BottomNavigationView.onSizeChanged(BottomNavigationView.java:156)   at android.view.View.sizeChange(View.java:17641)   at android.view.View.setFrame(View.java:17603)   at android.view.View.layout(View.java:17520)   at android.view.ViewGroup.layout(ViewGroup.java:5612)   at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741)   at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1730)   at android.widget.LinearLayout.onLayout(LinearLayout.java:1496)   at android.view.View.layout(View.java:17523)   at android.view.ViewGroup.layout(ViewGroup.java:5612)   at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)   at android.widget.FrameLayout.onLayout(FrameLayout.java:261)   at android.view.View.layout(View.java:17523)   at android.view.ViewGroup.layout(ViewGroup.java:5612)   at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)   at android.view.View.layout(View.java:17523)   at android.view.ViewGroup.layout(ViewGroup.java:5612) Copy stack to clipboard   Tip: Try to refresh the layout.  

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions