网络请求 OKHttp,研究一下
V - Layout
http://www.jianshu.com/p/6b658c8802d1
gsonformat 快速生成bean插件
File->Settings..->Plugins-->Browse repositores..搜索GsonFormat
常用build.gradle
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
compile "io.reactivex.rxjava2:rxjava:2.1.0"
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'com.jakewharton:butterknife:8.6.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.8.0'
public interface Service {
@GET("/")//网址下面的子目录
Call<String> getBaidu();
@GET("/api/{category}/list")//网址下面的子目录 category表示分类,因为子目录只有一点不一样
Call<Tngou> getList(@Path("category") String path,@Query("id") int id, @Query("page") int page, @Query("rows") int rows);
}
代码片段
public static void actionStrart (Context context, String data1) {
Intent intent = new Intent(context,Main2Activity.class);
intent.putExtra("param1", data1);
context.startActivity(intent);
}
查看当前线程
Log.d("LoginActivity",Thread.currentThread().getName());