Initialize OwnCloud_Reader on demand, remove init method

This commit is contained in:
Daniel Schaal 2015-10-03 10:07:39 +02:00
parent 230070b234
commit 38b87fa8c8
2 changed files with 1 additions and 8 deletions

View file

@ -21,7 +21,6 @@ public class NewsReaderApplication extends Application {
public void onCreate() {
super.onCreate();
HttpJsonRequest.init(this);
OwnCloud_Reader.init(this);
initImageLoader();
}

View file

@ -38,15 +38,9 @@ import de.luhmer.owncloudnewsreader.reader.OnAsyncTaskCompletedListener;
public class OwnCloud_Reader {
private static OwnCloud_Reader instance;
public static void init(Context context) {
if(instance != null)
throw new IllegalStateException("Already initialized");
instance = new OwnCloud_Reader();
}
public static OwnCloud_Reader getInstance() {
if(instance == null)
throw new IllegalStateException("Must be initialized first");
instance = new OwnCloud_Reader();
return instance;
}