java.lang.NullPointerException

tip
Do you find the tips below useful? Click on the to mark them and say thanks to Rafael Fischer Viola and rafael . Or join the community to write better ones.
  1. 0
    samebug tip
    If you're using nested fragments, you have to use childFragmentManager instead of fragmentManager.
  2. 0
    samebug tip
    As of SDK 23, you have to call this method with ContextCompat.getColor(context, R.color.my_color) so it works with previous API as well. Also, you have to add the support V4 library to your dependencies: "compile 'com.android.support:support-v4:23.0.1'"
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0
    samebug tip
    When you use findViewById inside an activity it is going to look for a View inside your main_activity.xml. If it's not there, it throws this exception, try to use the right view to call findviewById.
  5. 0
    samebug tip
    Annotation processor is not running in your project. Clean and rebuild your project. You can also delete .apt_generated folder, for a cleaner build.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at com.pemas.mac.pemas.DaftarPengaduan.onActivityCreated()
    2. com.pemas.mac
      DaftarPengaduan.onActivityCreated
      1. com.pemas.mac.pemas.DaftarPengaduan.onActivityCreated(DaftarPengaduan.java:44)
      1 frame
    3. Android Platform
      ActivityThread.main
      1. android.app.FragmentManagerImpl.moveToState(FragmentManager.java:848)
      2. android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1035)
      3. android.app.BackStackRecord.run(BackStackRecord.java:635)
      4. android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1399)
      5. android.app.FragmentManagerImpl$1.run(FragmentManager.java:426)
      6. android.os.Handler.handleCallback(Handler.java:615)
      7. android.os.Handler.dispatchMessage(Handler.java:92)
      8. android.os.Looper.loop(Looper.java:137)
      9. android.app.ActivityThread.main(ActivityThread.java:4944)
      9 frames
    4. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invokeNative(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:511)
      2 frames
    5. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
      2 frames
    6. Android Platform
      NativeStart.main
      1. dalvik.system.NativeStart.main(Native Method)
      1 frame