java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getVisibility()' on a null object reference

Stack Overflow | Hugh Myron | 5 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

    Unable to access view from my activity's method? (null object reference)

    Stack Overflow | 5 months ago | Hugh Myron
    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getVisibility()' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'int android.view.View.getVisibility()' on a null object reference

      at com.example.zigo.photoencryption.ViewImageActivity.toggleTopBottomViews()
    2. com.example.zigo
      TouchImageView$GestureListener.onSingleTapConfirmed
      1. com.example.zigo.photoencryption.ViewImageActivity.toggleTopBottomViews(ViewImageActivity.java:273)
      2. com.example.zigo.photoencryption.TouchImageView$GestureListener.onSingleTapConfirmed(TouchImageView.java:764)
      2 frames
    3. Android Platform
      ActivityThread.main
      1. android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:300)
      2. android.os.Handler.dispatchMessage(Handler.java:102)
      3. android.os.Looper.loop(Looper.java:148)
      4. android.app.ActivityThread.main(ActivityThread.java:5417)
      4 frames
    4. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      1 frame
    5. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
      2 frames