Commit aa691ba3 authored by Administrator's avatar Administrator

udpate

parent fc157a75
......@@ -25,6 +25,7 @@ import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;
import top.wuhaojie.installerlibrary.AutoInstaller;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
......@@ -77,7 +78,13 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
textView.setText(deviceMsg.toString());
Request request = HttpClientUtils.postRequest("http://taskcenter.beta.qunar.com/api/phone/report", deviceMsg);
String serverUrl = "https://hotelcrawl.qunar.com/api/phone/report";
textView.setText(serverUrl);
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("https://hotelcrawl.qunar.com/api/phone/report", deviceMsg);
HttpClientUtils.getClient().newCall(request).enqueue(new Callback() {
@Override
......@@ -89,7 +96,19 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
public void onResponse(@javax.annotation.Nullable Call call, @javax.annotation.Nullable Response response) {
try {
if (response != null) {
Log.e("report response", response.body().string());
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();
......
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