java - Initializing Context class in an Android application (for OSMdroid) -


how initialize "context context" correctly in case. android studio tells me should initialized, dont know how. if set null, app crashes @ start.

this @ top of class:

mylocationnewoverlay mlocationoverlay; 

this on over create method:

context context = null;     this.mlocationoverlay = new mylocationnewoverlay(new gpsmylocationprovider(context),map);     this.mlocationoverlay.enablemylocation();     map.getoverlays().add(this.mlocationoverlay); } 


Comments

Popular posts from this blog

c# SetCompatibleTextRenderingDefault must be called before the first -

c++ - Fill runtime data at compile time with templates -

C#.NET Oracle.ManagedDataAccess ConfigSchema.xsd -