今天先在这里列一下提纲,总结下项目中遇到的问题。
1.内存泄露相关问题
(1)Handler造成的内存泄露
(2)使用AsyncTask造成的内存泄露
2.
我们在自定义view时,如果要在xml直接饮用该自定义view,一定要在自定义view类中覆写带attributeSet参数的方法,否则会报错:
1
2
3
4
5
|
public
LoadMoreRecyclerView(Context context, AttributeSet attrs) {
super
(context, attrs);
init();
}
|
3.自定义组件inflate第三个参数为true和为false的区别?
自定义View中inflater.inflate这个函数中的参数?
/** * Inflate a new view hierarchy from the specified xml resource. Throws * {@link InflateException} if there is an error. * * @param resource ID for an XML layout resource to load (e.g., * <code>R.layout.main_page</code>) * @param root Optional view to be the parent of the generated hierarchy (if * <em>attachToRoot</em> is true), or else simply an object that * provides a set of LayoutParams values for root of the returned * hierarchy (if <em>attachToRoot</em> is false.) * @param attachToRoot Whether the inflated hierarchy should be attached to * the root parameter? If false, root is only used to create the * correct subclass of LayoutParams for the root view in the XML. * @return The root View of the inflated hierarchy. If root was supplied and * attachToRoot is true, this is root; otherwise it is the root of * the inflated XML file. */ public View inflate(int resource, ViewGroup root, boolean attachToRoot)
如果root传的是null是什么结果?自定义组件时,什么时候传入null?什么时候要传入this,什么时候要传入parent?
attachToRoot的值如何决定?默认是true,那么什么时候要设为false?
4.预加载闪屏问题
5.ListView快速滑动图片加载问题
6.下拉刷新时,页面如何动态滚动回去
7.android动画animation的Fillafter=true和Animator的区别
8.缓存边读编写的方法
9.百度sdk引起的崩溃问题如何解决
10.位运算的使用技巧
11.activity要隐式调用需要定义action和category,如果只定义action,而没有定义category为
<category android:name="android.intent.category.DEFAULT"/>
是无法调起的。
12.当我们用v4包的Fragment时,activity一般会继承自FragmentActivity,这个时候我们要注意,覆写时设置setContentView是在这个里边设
protected void onCreate(Bundle savedInstanceState) {
而不是
public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
这个方法如何使用,可以参考:http://blog.csdn.net/lincyang/article/details/45287599
13. 8.动态添加自定义View如何设置weight?如何让weight生效?
14.overridePendingTransition的简介可以用来配置activity进入进出动画