比如老师敲了个call.execute()然后前面的那个Response是怎么快速出来的啊?快捷键是什么啊?
Ctrl + Alt + V
因为应用要经常发送http请求,包装一个方法
public class HttpUtil {
public static void sendOkhttpRequest(String adress,okhttp3.Callback callback) {
OkHttpClient okHttpClient = new OkHttpClient();
Request.Builder builder = new Request.Builder();
Request request = builder.get()
.url(adress)
.build();
Call call=okHttpClient.newCall(request);
call.enqueue(callback);
}
}
ctrl+alt+f