OsmDroid: User agent doesn't work with Fragments

Every example available on the internet tells us to use this line of code to get the user agent (without it the map won't load).

osm.osmdroid.config.Configuration.getInstance()
            .load(applicationContext, this.getPreferences(Context.MODE_PRIVATE))

The problem is that applicationContext yields "Unresolved reference". Same goes for this.getPreferences().

I've tried to put that code into MainActivity (no fragments) and it works. Is there any way to replace it in this context?



Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation