I have noticed that tiles are not showing on the map UI element after opening the activity. This is happening for new Android version 8.1.
Do you know what could be the problem?
Are there any new app permissions to declare?
The OSMDroid maps require External storage permission. Even if you add it to the manifest file the user needs to grant the permission during runtime manually if the api level > 23
@Override public void onCreate(Bundle savedInstanceState) {
if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
//app has permissions, do your normal job here.
} else {
ActivityCompat.requestPermissions(this, new String[]{
Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);
}
}
And the request permission result
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == 1) {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
//refresh view or recreate the Activity
}
}
}