DirectByteBuffer Exceptional whale getting different cards in fragments
I am creating an application that fetches 2 or 3 cards and shows them in the viewpager. sometimes it crashes and shows the below errors.
FATAL EXCEPTION: GLThread 2477
java.lang.NullPointerException
at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:344)
at java.nio.ByteBufferAsShortBuffer.put(ByteBufferAsShortBuffer.java:160)
at com.google.maps.api.android.lib6.gmm6.o.c.a.d.d(Unknown Source)
at com.google.maps.api.android.lib6.gmm6.o.c.a.d.a(Unknown Source)
at com.google.maps.api.android.lib6.gmm6.o.a.a(Unknown Source)
at com.google.maps.api.android.lib6.gmm6.o.c.b(Unknown Source)
at com.google.maps.api.android.lib6.gmm6.o.c.a(Unknown Source)
at com.google.maps.api.android.lib6.gmm6.o.l.a(Unknown Source)
at com.google.maps.api.android.lib6.gmm6.o.l.b(Unknown Source)
at com.google.maps.api.android.lib6.gmm6.o.cw.k(Unknown Source)
at com.google.maps.api.android.lib6.gmm6.o.cw.run(Unknown Source)
there is no information about the cause of this error in logcat. I am unable to track down the error. what could be the possible causes of this error and how can i solve this problem.
source to share
I got a problem with the same stacktrace when I used MapView
in a custom fragment (not MapFragment
), however I was not using the ViewPager. It turns out I forgot to call MapView.onPause()
but was calling all the other callbacks MapView
. Adding this block fixed the problem in my case:
@Override
public void onPause() {
mapView.onPause();
super.onPause();
}
source to share