diff --git a/hppmanager/src/main/java/com/realex/hppmanager/HPPManagerFragment.java b/hppmanager/src/main/java/com/realex/hppmanager/HPPManagerFragment.java index 5ad33d3..8bc9b38 100644 --- a/hppmanager/src/main/java/com/realex/hppmanager/HPPManagerFragment.java +++ b/hppmanager/src/main/java/com/realex/hppmanager/HPPManagerFragment.java @@ -23,15 +23,20 @@ import android.webkit.WebView; import android.webkit.WebViewClient; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; + import org.apache.http.NameValuePair; import org.apache.http.message.BasicNameValuePair; import java.io.UnsupportedEncodingException; import java.lang.reflect.Method; +import java.lang.reflect.Type; import java.net.URLEncoder; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Map; import retrofit.Callback; import retrofit.RetrofitError; @@ -47,7 +52,7 @@ **/ -public class HPPManagerFragment extends Fragment implements Callback { +public class HPPManagerFragment extends Fragment implements Callback { private HPPManagerListener mListener; private View root; @@ -130,7 +135,7 @@ public void onDestroy() { @TargetApi(Build.VERSION_CODES.KITKAT) @Override - public void success(HPPResponse hppResponse, Response response) { + public void success(Response hppResponse, Response response) { final WebView webView = (WebView) root.findViewById(R.id.hpp_web_view); @@ -244,9 +249,13 @@ public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError e List nvps = new ArrayList(); - HashMap params = hppManager.getMap(); - HashMap consumer_response_params = hppResponse.getMap(); + String resp = new String(((TypedByteArray) response.getBody()).getBytes()); + + HashMap params = new HashMap<>();//hppManager.getMap(); + + Type mapType = new TypeToken>(){}.getType(); + Map consumer_response_params = new Gson().fromJson(resp, mapType); //merge params for (String key : consumer_response_params.keySet()) { diff --git a/hppmanager/src/main/java/com/realex/hppmanager/IHPPServerAPI.java b/hppmanager/src/main/java/com/realex/hppmanager/IHPPServerAPI.java index cc3607f..bfcf941 100644 --- a/hppmanager/src/main/java/com/realex/hppmanager/IHPPServerAPI.java +++ b/hppmanager/src/main/java/com/realex/hppmanager/IHPPServerAPI.java @@ -19,7 +19,7 @@ interface IHPPServerAPI { @FormUrlEncoded @POST("/{path}") public void getHPPRequest(@Path(value = "path", encode = false) String path, @FieldMap HashMap args, - Callback callback); + Callback callback); @FormUrlEncoded @POST("/{path}")