Initialize OwnCloud_Reader on demand, remove init method
This commit is contained in:
parent
230070b234
commit
38b87fa8c8
2 changed files with 1 additions and 8 deletions
|
@ -21,7 +21,6 @@ public class NewsReaderApplication extends Application {
|
|||
public void onCreate() {
|
||||
super.onCreate();
|
||||
HttpJsonRequest.init(this);
|
||||
OwnCloud_Reader.init(this);
|
||||
initImageLoader();
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue