项目过程中遇到的问题及小知识点总结

         今天先在这里列一下提纲,总结下项目中遇到的问题。

         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进入进出动画



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值