1.Gosn解析数组类型的字符串
List<ColumnBean> columnBean = gson.fromJson(json, new TypeToken<List<ColumnBean>>() {
}.getType ());
2.recycleview item混乱 Imagaview设置 android :scaleType= "fitXY"
3. 去掉lable @Override
protected void onCreate(Bundle savedInstanceState) {
super .onCreate(savedInstanceState);
//去掉lable
supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main ); initData(); initView();} 4.app-debug.apk可以运行的自己手机上,但是安装包不能运行在别的手机上,解决方法如下
5 butterknife ,是因为一个控件绑定了多次
Error:(110, 20) 错误: Attempt to use @BindView for an already bound ID 2131755174 on 'rlComment'. (com.shupu.ireader.ConmentDetailActivity.rlInputComment) Error:(106, 18) 错误: Attempt to use @BindView for an already bound ID 2131755179 on 'llComment'. (com.shupu.ireader.ConmentDetailActivity.llcomment)
6.设置状态栏透明 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
activity.getWindow().setStatusBarColor(Color.TRANSPARENT);
} else {
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}