java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Intent android.support.v4.app.FragmentActivity.registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter)' on a null object reference

Stack Overflow | hamed golbahar | 7 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

    BroadcastReceiver register and unregister not working in Android

    Stack Overflow | 7 months ago | hamed golbahar
    java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Intent android.support.v4.app.FragmentActivity.registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter)' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'android.content.Intent android.support.v4.app.FragmentActivity.registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter)' on a null object reference

      at osclassapp.faosclass.com.osclassapp.ThreeFragment$PostGetter$1.customLoadMoreDataFromApi()
    2. osclassapp.faosclass.com
      EndlessScrollListener.onScroll
      1. osclassapp.faosclass.com.osclassapp.ThreeFragment$PostGetter$1.customLoadMoreDataFromApi(ThreeFragment.java:483)
      2. osclassapp.faosclass.com.osclassapp.ThreeFragment$PostGetter$1.onLoadMore(ThreeFragment.java:475)
      3. osclassapp.faosclass.com.osclassapp.EndlessScrollListener.onScroll(EndlessScrollListener.java:59)
      3 frames
    3. Android Platform
      AbsListView.setOnScrollListener
      1. android.widget.AbsListView.invokeOnItemScrollListener(AbsListView.java:1948)
      2. android.widget.AbsListView.setOnScrollListener(AbsListView.java:1937)
      2 frames
    4. osclassapp.faosclass.com
      ThreeFragment$PostGetter.onPostExecute
      1. osclassapp.faosclass.com.osclassapp.ThreeFragment$PostGetter.onPostExecute(ThreeFragment.java:472)
      1 frame
    5. Android Platform
      Looper.loop
      1. android.os.AsyncTask.finish(AsyncTask.java:636)
      2. android.os.AsyncTask.access$500(AsyncTask.java:177)
      3. android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:653)
      4. android.os.Handler.dispatchMessage(Handler.java:102)
      5. android.os.Looper.loop(Looper.java:145)
      5 frames