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

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept