title: android : Nested scrollview Throwing exception in Fragment
body: <p>I have one layout like following    </p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MainActivity"&gt;
  
      &lt;android.support.v4.widget.NestedScrollView
          android:id="@+id/upperSroll"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:nestedScrollingEnabled="true"
          &gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"&gt;
  
              &lt;ScrollView
                  android:id="@+id/innerSroll"
                  android:layout_width="match_parent"
                  android:layout_height="0dp"
                  android:layout_weight="1"&gt;
  
                  &lt;LinearLayout
                      android:id="@+id/up"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:orientation="vertical"&gt;
  
                      &lt;TextView
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_marginTop="50dp"
                          android:text="csdsbfsfbsdf sfjdsfjdsfhjsd" /&gt;
  
                      &lt;TextView
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_marginTop="50dp"
                          android:text="csdsbfsfbsdf sfjdsfjdsfhjsd" /&gt;
  
                      &lt;TextView
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_marginTop="50dp"
                          android:text="csdsbfsfbsdf sfjdsfjdsfhjsd" /&gt;
  
                      &lt;TextView
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_marginTop="50dp"
                          android:text="csdsbfsfbsdf sfjdsfjdsfhjsd" /&gt;
  
                      &lt;TextView
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_marginTop="50dp"
                          android:text="csdsbfsfbsdf sfjdsfjdsfhjsd" /&gt;
  
                      &lt;TextView
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_marginTop="50dp"
                          android:text="csdsbfsfbsdf sfjdsfjdsfhjsd" /&gt;
  
                      &lt;TextView
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_marginTop="50dp"
                          android:text="csdsbfsfbsdf sfjdsfjdsfhjsd" /&gt;
  
                      &lt;TextView
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_marginTop="50dp"
                          android:text="csdsbfsfbsdf sfjdsfjdsfhjsd" /&gt;
                  &lt;/LinearLayout&gt;
              &lt;/ScrollView&gt;
  
              &lt;RelativeLayout
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:layout_below="@id/innerSroll"
                  android:layout_weight="1"
                  android:background="@color/colorAccent"
                  android:orientation="vertical"&gt;
  
                  &lt;ImageView
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:background="@drawable/ic_launcher_background" /&gt;
              &lt;/RelativeLayout&gt;
          &lt;/LinearLayout&gt;
      &lt;/android.support.v4.widget.NestedScrollView&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>It is working perfectly without adding <code>android:nestedScrollingEnabled="true"</code>.If I add this line in layout I get following exception in Fragment </p>
  
  <pre><code>    07-22 12:07:33.694 13199-13199/com.example.mukesh.nestedscrollsample E/AndroidRuntime: FATAL EXCEPTION: main
      Process: com.example.mukesh.nestedscrollsample, PID: 13199
      java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mukesh.nestedscrollsample/com.example.mukesh.nestedscrollsample.MainActivity}: android.view.InflateException: Binary XML file line #8: Binary XML file line #8: Error inflating class android.support.v4.widget.NestedScrollView
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3003)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3064)
          at android.app.ActivityThread.-wrap14(ActivityThread.java)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1659)
          at android.os.Handler.dispatchMessage(Handler.java:102)
          at android.os.Looper.loop(Looper.java:154)
          at android.app.ActivityThread.main(ActivityThread.java:6823)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
       Caused by: android.view.InflateException: Binary XML file line #8: Binary XML file line #8: Error inflating class android.support.v4.widget.NestedScrollView
       Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class android.support.v4.widget.NestedScrollView
       Caused by: java.lang.reflect.InvocationTargetException
          at java.lang.reflect.Constructor.newInstance0(Native Method)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
          at android.view.LayoutInflater.createView(LayoutInflater.java:652)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:794)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:865)
          at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:525)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
          at com.example.mukesh.nestedscrollsample.BlankFragment.onCreateView(BlankFragment.java:67)
          at android.support.v4.app.Fragment.performCreateView(Fragment.java:2425)
          at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1460)
          at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
          at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
          at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:802)
          at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2623)
          at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2410)
          at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2365)
          at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2272)
          at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3271)
          at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3227)
          at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:201)
          at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:610)
          at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
          at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1256)
          at android.app.Activity.performStart(Activity.java:6994)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2956)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3064)
          at android.app.ActivityThread.-wrap14(ActivityThread.java)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1659)
          at android.os.Handler.dispatchMessage(Handler.java:102)
          at android.os.Looper.loop(Looper.java:154)
          at android.app.ActivityThread.main(ActivityThread.java:6823)
          at java.lang.reflect.Method.invoke(Native Method)
  07-22 12:07:33.695 13199-13199/com.example.mukesh.nestedscrollsample E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
       Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.view.NestedScrollingChildHelper.setNestedScrollingEnabled(boolean)' on a null object reference
          at android.support.v4.widget.NestedScrollView.setNestedScrollingEnabled(NestedScrollView.java:251)
          at android.view.View.&lt;init&gt;(View.java:4877)
          at android.view.ViewGroup.&lt;init&gt;(ViewGroup.java:582)
          at android.widget.FrameLayout.&lt;init&gt;(FrameLayout.java:92)
          at android.widget.FrameLayout.&lt;init&gt;(FrameLayout.java:87)
          at android.support.v4.widget.NestedScrollView.&lt;init&gt;(NestedScrollView.java:198)
          at android.support.v4.widget.NestedScrollView.&lt;init&gt;(NestedScrollView.java:193)
              ... 36 more
  </code></pre>
  
  <p>What I need: 
  In Normal mode Inner scroll should work and in multi window mode inner scroll all item should exposed and outer scroll should work.</p>
  
  <p>I tried setting NestedScrollEnable false in code but it is not working.</p>