if(ContextCompat.checkSelfPermission(MainActivity.this,Manifest.permission.WRITE_EXTERNAL_STORAGE)!=PackageManager.PERMISSION_GRANTED){ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);} else {sendRequestWithOkhttp4();}
2018-02-04
//2.构造Request
RequestBody requestBody = new FormBody.Builder()
.add("username","admin").add("password","123").build();
Request request = new Request.Builder()
.url(mBaseUrl+"login").post(requestBody).build();
RequestBody requestBody = new FormBody.Builder()
.add("username","admin").add("password","123").build();
Request request = new Request.Builder()
.url(mBaseUrl+"login").post(requestBody).build();
2018-02-04
最新回答 / 咦_哎呦
依赖是用Android studio时需要添加的,用eclipse时要下载对应的jar包,然后导入就可以使用了,不过现在做安卓还是用Android studio吧
2017-12-06