Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ open class CycleMapFragment : Fragment(), Undoable {
map!!.onResume()
}

override fun onDestroy() {
map!!.onDestroy()
super.onDestroy()
}

override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
if (map != null)
map!!.onCreateOptionsMenu(menu)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ abstract class MainNavDrawerActivity : AppCompatActivity(), OnNavigationItemSele
else if (CycleStreetsAppSupport.isNewVersion())
onNewVersion()
CycleStreetsAppSupport.splashScreenSeen()

val selectedItem = prefs().getInt(DRAWER_ITEMID_SELECTED_KEY, R.id.nav_journey_planner)
// If menu item not found, show journey planner
if (!showPage(selectedItem))
showPage(R.id.nav_journey_planner)
}

override fun onOptionsItemSelected(item: MenuItem): Boolean {
Expand Down Expand Up @@ -184,9 +189,6 @@ abstract class MainNavDrawerActivity : AppCompatActivity(), OnNavigationItemSele
}

public override fun onResume() {
val selectedItem = prefs().getInt(DRAWER_ITEMID_SELECTED_KEY, R.id.nav_journey_planner)
if (!showPage(selectedItem))
showPage(R.id.nav_journey_planner)
super.onResume()
Route.registerListener(this)
setBlogStateTitle()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,10 @@ public void onPause() {

// These lines effectively shut down the map.
// This object needs to be discarded and re-created on resuming.
getTileProvider().detach();
getTileProvider().clearTileCache();
BitmapPool.getInstance().clearBitmapPool();
// Moved to onDestroy (todo remove commented out lines below)
//getTileProvider().detach();
//getTileProvider().clearTileCache();
//BitmapPool.getInstance().clearBitmapPool();
}

public void onResume() {
Expand Down Expand Up @@ -227,6 +228,11 @@ public void onTick(long unfinished) { }
}.start();
}

public void onDestroy() {
getTileProvider().detach();
//getTileProvider().clearTileCache(); todo not needed as this is in detach
BitmapPool.getInstance().clearBitmapPool();
}
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
public void onCreateOptionsMenu(final Menu menu) {
Expand Down