1# getResources().getDisplayMetrics().density//获得相对密度(0.75,1.0.1.5等)
2#生成jar的时候 要用动态寻找id的方式
3# 可以用这样的方式显示一段text中某些带颜色的字体:
textview.setText(Html.fromHtml("评价"+"<font color=#6897c6>" + 9 + "</font>人")) 效果如图
4#用阿里巴巴fastjson解析的时候保持实体类不被混淆,否则不能解析成功,并且keep一下
#保持 fastjson -keep class com.alibaba.fastjson.** { *; }
-keep class XXXXX.XXXXX.CityEntity{*;}
5#
自定义的fragment最好有一个Public的参数为空的构造函数,若需要传入一个参数,可以使用下面的方法
public FileViewFragment(){
}
public static FileViewFragment getInstance(A a){
FileViewFragment fileViewFragment = new FileViewFragment();
fileViewFragment.a = a;
return fileViewFragment;
}
public FileViewFragment(){