{"action":"created","issue":{"url":"https://api.github.com/repos/osmdroid/osmdroid/issues/644","repository_url":"https://api.github.com/repos/osmdroid/osmdroid","labels_url":"https://api.github.com/repos/osmdroid/osmdroid/issues/644/labels{/name}","comments_url":"https://api.github.com/repos/osmdroid/osmdroid/issues/644/comments","events_url":"https://api.github.com/repos/osmdroid/osmdroid/issues/644/events","html_url":"https://github.com/osmdroid/osmdroid/issues/644","id":246223813,"number":644,"title":"Osmdroid MapView always displays downloaded mbtile","user":{"login":"kingfisherphuoc","id":962484,"avatar_url":"https://avatars0.githubusercontent.com/u/962484?v=4","gravatar_id":"","url":"https://api.github.com/users/kingfisherphuoc","html_url":"https://github.com/kingfisherphuoc","followers_url":"https://api.github.com/users/kingfisherphuoc/followers","following_url":"https://api.github.com/users/kingfisherphuoc/following{/other_user}","gists_url":"https://api.github.com/users/kingfisherphuoc/gists{/gist_id}","starred_url":"https://api.github.com/users/kingfisherphuoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kingfisherphuoc/subscriptions","organizations_url":"https://api.github.com/users/kingfisherphuoc/orgs","repos_url":"https://api.github.com/users/kingfisherphuoc/repos","events_url":"https://api.github.com/users/kingfisherphuoc/events{/privacy}","received_events_url":"https://api.github.com/users/kingfisherphuoc/received_events","type":"User","site_admin":false},"labels":[{"id":105049584,"url":"https://api.github.com/repos/osmdroid/osmdroid/labels/waiting%20for%20feedback","name":"waiting for feedback","color":"c2e0c6","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-07-28T02:54:10Z","updated_at":"2018-02-10T18:22:05Z","closed_at":"2018-02-10T18:22:05Z","author_association":"NONE","body":"I want to display the downloaded map tiles only when there's no internet connection. This is the code I tried:\r\n```java\r\nif (NetworkUtils.isNetworkAvailable(container.getContext())) {\r\n            mapView.setUseDataConnection(true);\r\n        } else {\r\n            mapView.setUseDataConnection(false);\r\n            mapView.setTileSource(FourUMapsTileSource);\r\n        }\r\n```\r\nHowever, the downloaded map is always displayed even when there's network connection (see the image below):\r\n![device-2017-07-28-095041](https://user-images.githubusercontent.com/962484/28700547-9e7e4724-737a-11e7-9066-09e7200a93f2.png)\r\nDo you have any idea? @spyhunter99 "},"comment":{"url":"https://api.github.com/repos/osmdroid/osmdroid/issues/comments/364678094","html_url":"https://github.com/osmdroid/osmdroid/issues/644#issuecomment-364678094","issue_url":"https://api.github.com/repos/osmdroid/osmdroid/issues/644","id":364678094,"user":{"login":"spyhunter99","id":1975321,"avatar_url":"https://avatars2.githubusercontent.com/u/1975321?v=4","gravatar_id":"","url":"https://api.github.com/users/spyhunter99","html_url":"https://github.com/spyhunter99","followers_url":"https://api.github.com/users/spyhunter99/followers","following_url":"https://api.github.com/users/spyhunter99/following{/other_user}","gists_url":"https://api.github.com/users/spyhunter99/gists{/gist_id}","starred_url":"https://api.github.com/users/spyhunter99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spyhunter99/subscriptions","organizations_url":"https://api.github.com/users/spyhunter99/orgs","repos_url":"https://api.github.com/users/spyhunter99/repos","events_url":"https://api.github.com/users/spyhunter99/events{/privacy}","received_events_url":"https://api.github.com/users/spyhunter99/received_events","type":"User","site_admin":false},"created_at":"2018-02-10T18:22:05Z","updated_at":"2018-02-10T18:22:05Z","author_association":"COLLABORATOR","body":"answer/workaround posted, reopen if this is still a problem"}}
{"actor":{"display_login":"spyhunter99"}}