title: TimeoutException on ViewPager setAdapter Android
body: <p>I am developing Android App and I am using view pager inside a fragment but when I tried to setAdapter it's showing me Failed to execute a task.</p>
  
  <pre><code>java.util.concurrent.TimeoutException
  </code></pre>
  
  <p>Here how I am setting Adapter inside fragment:</p>
  
  <pre><code>SectionsPagerAdapter mSectionsPagerAdapter = new SectionsPagerAdapter(getActivity().getSupportFragmentManager(),
                      tabLayout.getTabCount(), drugAdherenceDto, selectedDate);
  
              mViewPager.setAdapter(mSectionsPagerAdapter);
              mSectionsPagerAdapter.notifyDataSetChanged();
  </code></pre>
  
  <p>Here is the Logcat:</p>
  
  <pre><code>    E/CrashlyticsCore: Failed to execute task.
          java.util.concurrent.TimeoutException
              at java.util.concurrent.FutureTask.get(FutureTask.java:177)
              at com.crashlytics.android.core.CrashlyticsBackgroundWorker.submitAndWait(CrashlyticsBackgroundWorker.java:41)
              at com.crashlytics.android.core.CrashlyticsController.handleUncaughtException(CrashlyticsController.java:320)
              at com.crashlytics.android.core.CrashlyticsController$6.onUncaughtException(CrashlyticsController.java:300)
              at com.crashlytics.android.core.CrashlyticsUncaughtExceptionHandler.uncaughtException(CrashlyticsUncaughtExceptionHandler.java:42)
              at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
              at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1063)
  E/System: Uncaught exception thrown by finalizer
  </code></pre>
  
  <p>When I debug further put try-catch and I found that It's throwing:</p>
  
  <pre><code>stack overflow exception
  </code></pre>
  
  <p>Can anyone help me how to resolve this issue?</p>