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
Post a Comment