-
Notifications
You must be signed in to change notification settings - Fork 1.3k
MapView in fragment not working and the app freezes after calling recreate() in the host activity #11121
Comments
Thank you for reaching out and using our products, as noted in the javadoc, you need to call |
@tobrun I already tried with
Is there anything I'm missing ? |
I also tested with the |
@minthura was able to reproduce: adding the following solves your issue:
The activity itself manages fragment recreation on its own. I will work on hardening this integration. |
Debugging shows very strange behavior, when you recreate the activity, I'm seeing 2 fragments being recreated and both share the same SurfaceView which results in the |
Hmm yeah that's strange. Anyway I could fix the issue with the way you suggested for now. Thanks @tobrun. |
Hi, My Fragment layout: `
` My Fragment: import android.arch.lifecycle.Observer class EvantDetailsFragment : Fragment() { // override fun onMapReady(googleMap: GoogleMap?) {
}` Error Logcat: Any idea? Thanks! |
You are using a Google Map in your xml and not a Mapbox one: <com.google.android.gms.maps.MapView
....
.> |
@prcGit I am getting the same error when using Google MapView - have you been able to solve it? (sorry for this post) |
@hi everyone i dont know why it is getting this problem... please check this out ... and i am following the instructions of the official website of mapbox... package com.example.vibloc; import android.app.Dialog; import com.mapbox.mapboxsdk.Mapbox; import android.support.annotation.NonNull; public class MainActivity extends AppCompatActivity {
} error is: please give me a solution for this ...asap thanks ... |
@VadlamudiNaveen a NullPointerException like that means that you haven't added a MapView decleration to your Xml layout file. |
Platform:
Android
Mapbox SDK version:
mapbox-android-sdk:5.4.0
Steps to trigger behavior
I've provided some codes for your reference.
MapFragment.java
MainActivity.java
Screenshot
![device-2018-02-06-154914](https://user-images.githubusercontent.com/6892286/35851132-672d883e-0b55-11e8-81d3-963050e5493b.png)
The text was updated successfully, but these errors were encountered: