mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Get rid of other singletons
This commit is contained in:
parent
bdfbdc7579
commit
c712b561d4
7 changed files with 31 additions and 31 deletions
|
|
@ -30,6 +30,7 @@ import fr.free.nrw.commons.contributions.Contribution;
|
|||
import fr.free.nrw.commons.data.DBOpenHelper;
|
||||
import fr.free.nrw.commons.modifications.ModifierSequence;
|
||||
import fr.free.nrw.commons.auth.AccountUtil;
|
||||
import fr.free.nrw.commons.nearby.NearbyPlaces;
|
||||
|
||||
import org.acra.ACRA;
|
||||
import org.acra.ReportingInteractionMode;
|
||||
|
|
@ -85,6 +86,8 @@ public class CommonsApplication extends Application {
|
|||
private MWApi api = null;
|
||||
private CacheController cacheData = null;
|
||||
private RequestQueue volleyQueue = null;
|
||||
private DBOpenHelper dbOpenHelper = null;
|
||||
private NearbyPlaces nearbyPlaces = null;
|
||||
|
||||
/**
|
||||
* This should not be called by ANY application code (other than the magic Android glue)
|
||||
|
|
@ -146,6 +149,20 @@ public class CommonsApplication extends Application {
|
|||
return volleyQueue;
|
||||
}
|
||||
|
||||
public synchronized DBOpenHelper getDBOpenHelper() {
|
||||
if(dbOpenHelper == null) {
|
||||
dbOpenHelper = new DBOpenHelper(this);
|
||||
}
|
||||
return dbOpenHelper;
|
||||
}
|
||||
|
||||
public synchronized NearbyPlaces getNearbyPlaces() {
|
||||
if (nearbyPlaces == null) {
|
||||
nearbyPlaces = new NearbyPlaces();
|
||||
}
|
||||
return nearbyPlaces;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue