Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Reload map tiles every onResume. #12724

Closed
sekitaka opened this issue Aug 23, 2018 · 1 comment · Fixed by #12844
Closed

Reload map tiles every onResume. #12724

sekitaka opened this issue Aug 23, 2018 · 1 comment · Fixed by #12844
Labels
Android Mapbox Maps SDK for Android

Comments

@sekitaka
Copy link

Hello, I have migrated the mapbox sdk to 6.4.0 from 5.1.5.
Then, It reloads map tiles every onResume.
Is this new specification?

ezgif com-video-to-gif

Steps to reproduce

  1. activity A that has mapview starts.
  2. activity B starts by button on activity A clicked.
  3. back to activity A

Expected behavior

Keep showing map tiles same as when left from activity A.

Actual behavior

Reload map tiles again.

Configuration

**Android versions:7.1.1
**Device models:PH-1
**Mapbox SDK versions: 6.4.0

@sekitaka
Copy link
Author

My activity code is here.

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        Mapbox.getInstance(getApplicationContext(), getString(R.string.mapbox_access_token));
        setContentView(R.layout.activity_main)
        mapView.onCreate(savedInstanceState)
        mapView.getMapAsync { mapboxMap ->
            mapboxMap.addMarker(MarkerOptions()
                    .position(LatLng(41.885, -87.679))
                    .title("Chicago")
                    .snippet("Illinois")
            )
        }
        button.setOnClickListener {
            val intent = Intent(this, SecondActivity::class.java)
            startActivity(intent)
        }
    }

    override fun onStart() {
        super.onStart()
        mapView.onStart()
    }

    override fun onResume() {
        super.onResume()
        mapView.onResume()
    }

    override fun onPause() {
        super.onPause()
        mapView.onPause()
    }

    override fun onStop() {
        super.onStop()
        mapView.onStop()
    }

    override fun onSaveInstanceState(outState: Bundle?, outPersistentState: PersistableBundle?) {
        super.onSaveInstanceState(outState, outPersistentState)
        outState?.let {
            mapView.onSaveInstanceState(it)
        }
    }

    override fun onLowMemory() {
        super.onLowMemory()
        mapView.onLowMemory()
    }

    override fun onDestroy() {
        super.onDestroy()
        mapView.onDestroy()
    }
}

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Aug 23, 2018
@LukasPaczos LukasPaczos added this to the android-v6.6.0 milestone Sep 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants