java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Handler android.support.v4.app.FragmentHostCallback.getHandler()' on a null object reference

Stack Overflow | Viks | 6 months ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Getting NullPointerException only on few devices while using setAdapter

    Stack Overflow | 6 months ago | Viks
    java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Handler android.support.v4.app.FragmentHostCallback.getHandler()' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'android.os.Handler android.support.v4.app.FragmentHostCallback.getHandler()' on a null object reference

      at android.support.v4.app.FragmentManagerImpl.execSingleAction()
    2. Android Support v4
      FragmentStatePagerAdapter.finishUpdate
      1. android.support.v4.app.FragmentManagerImpl.execSingleAction(FragmentManager.java:1623)
      2. android.support.v4.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:637)
      3. android.support.v4.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePagerAdapter.java:166)
      3 frames
    3. com.inheadline.news
      DataSnapshotToDb$AddToDb.onPostExecute
      1. com.inheadline.news.view.viewpager.VerticalViewPager.setAdapter(VerticalViewPager.java:278)
      2. com.inheadline.news.activity.MainActivity.setupViewPager(MainActivity.java:487)
      3. com.inheadline.news.activity.MainActivity.dataAdded(MainActivity.java:557)
      4. com.inheadline.news.db.operation.DataSnapshotToDb$AddToDb.onPostExecute(DataSnapshotToDb.java:163)
      5. com.inheadline.news.db.operation.DataSnapshotToDb$AddToDb.onPostExecute(DataSnapshotToDb.java:138)
      5 frames
    4. Android Platform
      ActivityThread.main
      1. android.os.AsyncTask.finish(AsyncTask.java:679)
      2. android.os.AsyncTask.access$500(AsyncTask.java:180)
      3. android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:696)
      4. android.os.Handler.dispatchMessage(Handler.java:102)
      5. android.os.Looper.loop(Looper.java:150)
      6. android.app.ActivityThread.main(ActivityThread.java:5546)
      6 frames
    5. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Method.java)
      1 frame
    6. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
      2 frames