Commit 5b7c8235 authored by Administrator's avatar Administrator

udapte

parent 5a8b3ca0
......@@ -81,39 +81,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
textView.setText(SchedulerTaskService.msgReportlUrl);
textView.append("\r\n" + deviceMsg);
// Request request = HttpClientUtils.postRequest("http://taskcenter.beta.qunar.com/api/phone/report", deviceMsg);
//https://hotelcrawl.qunar.com/api/phone/report
Request request = HttpClientUtils.postRequest(SchedulerTaskService.msgReportlUrl, deviceMsg);
HttpClientUtils.getClient().newCall(request).enqueue(new Callback() {
@Override
public void onFailure(@javax.annotation.Nullable Call call, @javax.annotation.Nullable IOException e) {
Log.e(Constant.TAG, "report device msg failed", e);
}
@Override
public void onResponse(@javax.annotation.Nullable Call call, @javax.annotation.Nullable Response response) {
try {
if (response != null) {
ResponseBody body = response.body();
if (body != null) {
final String responseStr = body.string();
MainActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
textView.append("\r\n" + responseStr);
}
});
Log.e("report response", responseStr);
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
});
SchedulerTaskService.runReportMessageTask(this);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment