diff options
Diffstat (limited to 'News-Android-App/src')
-rw-r--r-- | News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/LoginDialogFragment.java | 3 | ||||
-rw-r--r-- | News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/reader/HttpJsonRequest.java | 12 |
2 files changed, 2 insertions, 13 deletions
diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/LoginDialogFragment.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/LoginDialogFragment.java index 8d2c1e21..0c3003ce 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/LoginDialogFragment.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/LoginDialogFragment.java @@ -311,13 +311,14 @@ public class LoginDialogFragment extends DialogFragment implements IAccountImpor this.username = username; this.password = password; this.oc_root_path = oc_root_path; + HttpJsonRequest.init(getActivity()); + HttpJsonRequest.getInstance().setCredentials(username, password, oc_root_path); } @Override protected Integer doInBackground(Void... params) { try { - HttpJsonRequest.createNewInstance(getActivity()).setCredentials(username, password, oc_root_path); String _version = OwnCloudReaderMethods.GetVersionNumber(getActivity(), oc_root_path); if(_version != null) { diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/reader/HttpJsonRequest.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/reader/HttpJsonRequest.java index 82e41389..096c6701 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/reader/HttpJsonRequest.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/reader/HttpJsonRequest.java @@ -56,8 +56,6 @@ public class HttpJsonRequest { private static HttpJsonRequest instance; public static void init(Context context) { - if(instance != null) - throw new IllegalStateException("Already initialized"); instance = new HttpJsonRequest(context); } @@ -67,16 +65,6 @@ public class HttpJsonRequest { return instance; } - /** - * Destroys the current singleton and reinitialize the http-client e.g. if hostname verification changed - * @return Singleton Instance of HttpJsonRequest - */ - public static HttpJsonRequest createNewInstance(Context context) { - instance = null; - init(context); - return getInstance(); - } - private final OkHttpClient client; private final OkHttpClient imageClient; |