|
@@ -5,8 +5,6 @@ import android.content.Context;
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
-import okhttp3.MediaType;
|
|
|
-
|
|
|
/**
|
|
|
* @author myLove
|
|
|
* @time 2018/1/4 15:14
|
|
@@ -21,12 +19,11 @@ public class XMLRequest {
|
|
|
@SuppressLint("StaticFieldLeak")
|
|
|
private static Context mContext;
|
|
|
private static RequestType requestType;
|
|
|
- private static MediaType mediaType;
|
|
|
|
|
|
private XMLRequest() {
|
|
|
}
|
|
|
|
|
|
- public static XMLRequest getInstance(Context context, String str, String mediaTypeStr, RequestType type) {
|
|
|
+ public static XMLRequest getInstance(Context context, String str, RequestType type) {
|
|
|
if (instance == null) {
|
|
|
synchronized (XMLRequest.class) {
|
|
|
if (instance == null) {
|
|
@@ -36,16 +33,15 @@ public class XMLRequest {
|
|
|
}
|
|
|
mContext = context;
|
|
|
url = str;
|
|
|
- mediaType = MediaType.parse(str);
|
|
|
requestType = type;
|
|
|
return instance;
|
|
|
}
|
|
|
|
|
|
public void sync(String urlMsg, String labelStr, Map<Object, Object> map, onOkHttpListener onOkHttpListener) {
|
|
|
- ObservableRequest.getInstance(mediaType, urlMsg, labelStr, mContext, requestType, CallType.SYNC).request(url, map, onOkHttpListener);
|
|
|
+ ObservableRequest.getInstance(urlMsg, labelStr, mContext, requestType, CallType.SYNC).request(url, map, onOkHttpListener);
|
|
|
}
|
|
|
|
|
|
public void async(String urlMsg, String labelStr, Map<Object, Object> map, onOkHttpListener onOkHttpListener) {
|
|
|
- ObservableRequest.getInstance(mediaType, urlMsg, labelStr, mContext, requestType, CallType.ASYNC).request(url, map, onOkHttpListener);
|
|
|
+ ObservableRequest.getInstance(urlMsg, labelStr, mContext, requestType, CallType.ASYNC).request(url, map, onOkHttpListener);
|
|
|
}
|
|
|
}
|