title: BottomNavigationViewEx Null pointer exception
body: <p>My xml file contains the code:</p>
  
  <pre><code>&lt;com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx
          android:id="@+id/bnve"
          android:layout_gravity="bottom"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:background="@color/colorPrimary"
          app:itemIconTint="@drawable/bottom_navigation_colors"
          app:itemTextColor="@drawable/bottom_navigation_colors"
          app:menu="@menu/bottom_nav_menu" /&gt;
  </code></pre>
  
  <p>My java file contains:</p>
  
  <pre><code>BottomNavigationViewEx bnve = (BottomNavigationViewEx)findViewById(R.id.bnve);
  </code></pre>
  
  <p>It runs perfectly on an android device.
  But when I add the lines:</p>
  
  <pre><code>    bnve.enableAnimation(false);
      bnve.enableShiftingMode(false);
      bnve.enableItemShiftingMode(false);
  </code></pre>
  
  <p>the app crashes with the error:</p>
  
  <blockquote>
    <p>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bimsina.projectchautari/com.bimsina.projectchautari.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2583)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2665)
            at android.app.ActivityThread.-wrap11(ActivityThread.java)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1499)
            at android.os.Handler.dispatchMessage(Handler.java:111)
            at android.os.Looper.loop(Looper.java:207)
            at android.app.ActivityThread.main(ActivityThread.java:5765)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
         Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
            at com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.getBottomNavigationItemViews(BottomNavigationViewEx.java:569)
            at com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.enableAnimation(BottomNavigationViewEx.java:341)
            at com.bimsina.projectchautari.MainActivity.onCreate(MainActivity.java:94)
            at android.app.Activity.performCreate(Activity.java:6331)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113)</p>
  </blockquote>
  
  <p>Does someone have a solution?</p>
  
  <p>Edit: Heres my whole xml and java file.</p>
  
  <pre><code>  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MainActivity"&gt;
  
      &lt;TextView
          android:id="@+id/textView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Hello World!" /&gt;
  
      &lt;com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx
          android:id="@+id/bnve"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:menu="@menu/bottom_menu"/&gt;
  
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p>The java file is:</p>
  
  <pre><code>import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  
  import com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx;
  
  public class MainActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          BottomNavigationViewEx bnve= findViewById(R.id.bnve);
          bnve.enableAnimation(false);
          bnve.enableShiftingMode(false);
          bnve.enableItemShiftingMode(false);
      }
  }
  </code></pre>