blob: c1100e03486e451e1bbccfe21a209cc166bb8dd5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
package de.thedevstack.android.nextcloud.bookmark.share.async;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.preference.PreferenceManager;
import de.thedevstack.android.nextcloud.bookmark.share.Constants;
import de.thedevstack.android.nextcloud.bookmark.share.rest.NextcloudBookmarkRestClient;
/**
*/
public abstract class NextcloudBookmarkRestAsyncTask<Params, Result> extends AsyncTask<Params, Void, Result> {
protected NextcloudBookmarkRestClient client;
protected Context context;
public NextcloudBookmarkRestAsyncTask(Context context){
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
String serverUrl = prefs.getString(Constants.SERVER_URL_PREFERENCE_KEY, null);
String username = prefs.getString(Constants.USERNAME_PREFERENCE_KEY, null);
String password = prefs.getString(Constants.PASSWORD_PREFERENCE_KEY, null);
this.client = new NextcloudBookmarkRestClient(serverUrl, username, password);
this.context = context;
}
public NextcloudBookmarkRestAsyncTask(String serverUrl, String username, String password) {
this.client = new NextcloudBookmarkRestClient(serverUrl, username, password);
}
}
|