@Override protected Integer doInBackground(Object... params) { Context context = (Context) params[0]; int color = context.getResources().getColor(R.color.red); span = new ForegroundColorSpan(color); int first = (Integer) params[2]; int count = (Integer) params[3]; int cctv = (Integer) params[4]; String data = generateRequset(UserNow.current().userID, first, count, cctv); if (data != null) { String result = NetUtil.execute(context, data, null); if (result == null) { return Constants.fail_no_net; } else { ArrayList<TypeChannelData> list = (ArrayList<TypeChannelData>) params[1]; String msg = parse(list, result); if (msg == null) { return Constants.sucess; } else if ("parseErr".equals(msg)) { return Constants.parseErr; } else { errMsg = msg; return Constants.fail_server_err; } } } else { return Constants.requestErr; } }
@Override protected String doInBackground(Object... params) { Context context; MySpaceRequest request; LoginNewParser parser; String data; context = (Context) params[0]; listener = (NetConnectionListener) params[1]; request = (MySpaceRequest) params[2]; parser = (LoginNewParser) params[3]; data = request.make(); if (OtherCacheData.current().isDebugMode) Log.e(TAG, data); listener.onNetBegin(method); String s = NetUtil.execute(context, data, null); if (s != null) { if (OtherCacheData.current().isDebugMode) Log.e(TAG, s); String result = parser.parse(s); return result; } else { return null; } }