学到了,runOnUiThread(new Runnable()),之前我一直用handler sendMessage来更新Ui
2017-01-18
okhttp3更新
CookieManager cookieManager = new CookieManager();
cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
CookieJar cookieJar = new JavaNetCookieJar(cookieManager);
OkHttpClient.Builder builder = new OkHttpClient.Builder();
builder.cookieJar(cookieJar);
okHttpClient = builder.build();
CookieManager cookieManager = new CookieManager();
cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
CookieJar cookieJar = new JavaNetCookieJar(cookieManager);
OkHttpClient.Builder builder = new OkHttpClient.Builder();
builder.cookieJar(cookieJar);
okHttpClient = builder.build();
2017-01-01
MultipartBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("username","yy")
.addFormDataPart("password","zz0114yhbb")
.addFormDataPart("mPhoto","yy.jpg",RequestBody.create(MediaType.parse("application/octet-stream"),file))
.build();
.addFormDataPart("username","yy")
.addFormDataPart("password","zz0114yhbb")
.addFormDataPart("mPhoto","yy.jpg",RequestBody.create(MediaType.parse("application/octet-stream"),file))
.build();
2016-12-31