Sto ricevendo NullPointerException
in onTouchEvent
di CoordinatorLayout
.CoordinatorLayout NullPointerException in onTouchEvent
Sto usando DrawerLayout
con CollapsingToolbarLayout
di supporto Android AppCompat v23.0.0 libreria.
La mia osservazione si verifica in modo casuale mentre si scorre lo CollapsingToolbarLayout
o si fa clic sugli elementi del cassetto.
C'è qualcuno che sta affrontando questo problema? Qualche soluzione per evitare questa eccezione?
Logcat:
08-22 15:16:34.657: E/AndroidRuntime(27596): java.lang.NullPointerException: Attempt to invoke virtual method 'float android.view.MotionEvent.getX()' on a null object reference
08-22 15:16:34.657: E/AndroidRuntime(27596): at android.view.View.onTouchEvent(View.java:9321)
08-22 15:16:34.657: E/AndroidRuntime(27596): at android.support.design.widget.CoordinatorLayout.onTouchEvent(CoordinatorLayout.java:449)
08-22 15:16:34.657: E/AndroidRuntime(27596): at android.view.View.dispatchTouchEvent(View.java:8388)
08-22 15:16:34.657: E/AndroidRuntime(27596): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2398)
08-22 15:16:34.657: E/AndroidRuntime(27596): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2158)
08-22 15:16:34.657: E/AndroidRuntime(27596): at android.support.v4.widget.DrawerLayout.cancelChildViewTouch(DrawerLayout.java:1491)
08-22 15:16:34.657: E/AndroidRuntime(27596): at android.support.v4.widget.DrawerLayout$ViewDragCallback.peekDrawer(DrawerLayout.java:1739)
08-22 15:16:34.657: E/AndroidRuntime(27596): at android.support.v4.widget.DrawerLayout$ViewDragCallback.access$000(DrawerLayout.java:1624)
08-22 15:16:34.657: E/AndroidRuntime(27596): at android.support.v4.widget.DrawerLayout$ViewDragCallback$1.run(DrawerLayout.java:1630)
08-22 15:16:34.657: E/AndroidRuntime(27596): at android.os.Handler.handleCallback(Handler.java:739)
08-22 15:16:34.657: E/AndroidRuntime(27596): at android.os.Handler.dispatchMessage(Handler.java:95)
08-22 15:16:34.657: E/AndroidRuntime(27596): at android.os.Looper.loop(Looper.java:135)
08-22 15:16:34.657: E/AndroidRuntime(27596): at android.app.ActivityThread.main(ActivityThread.java:5221)
08-22 15:16:34.657: E/AndroidRuntime(27596): at java.lang.reflect.Method.invoke(Native Method)
08-22 15:16:34.657: E/AndroidRuntime(27596): at java.lang.reflect.Method.invoke(Method.java:372)
08-22 15:16:34.657: E/AndroidRuntime(27596): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
08-22 15:16:34.657: E/AndroidRuntime(27596): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
08-22 15:16:35.965: I/Process(27596): Sending signal. PID: 27596 SIG: 9
questo non ha funzionato – Markoe7