MyOkHttp.get().get(paramContext, "网址/interface/Mem?", paramString1, new JsonResponseHandler()
{
public void onFailure(int paramAnonymousInt, String paramAnonymousString)
{
Log.d("statusCode", String.valueOf(paramAnonymousInt));
Log.d("error_msg", paramAnonymousString);
paramAnonymousString = new User();
paramAnonymousString.setE_KeyTime("链接异常");
this.val$listener.onCallBack("empt", paramAnonymousString);
}
这样子写代码是很讨厌的,可读性很差
那么我们来看一下它
MyOkHttp.get().get(paramContext, "网址/interface/Mem?", paramString1, new JsonResponseHandler()
{
public void onFailure(int paramAnonymousInt, String paramAnonymousString)
{
Log.d("statusCode", String.valueOf(par...
那这样就很清晰了
JsonResponseHandler jsRespHandler = new JsonResponseHandler()
{
public void onFailure(int paramAnonymousInt, String paramAnonymousString)
{
Log.d("statusCode", String.valueOf(par... // 声明并实例化JsonResponseHandler对象
okHttpGet = MyOkHttp.get();
result = okHttpGet.get(paramContext, "网址/interface/Mem?", paramString1, jsRespHandler);
// 这里不清楚okHttpGet和result的类型就没加了