zoukankan      html  css  js  c++  java
  • android 容易出问题的地方

       1.没有加权限

        

         2.  LinearLayout没有指定 布局方式

       3.  Fragment操作问题  

                       The specified child already has a parent. You must call removeView() on the child's parent first

           问题分析  child已经存在parent

           因此:View view = inflater.inflate(R.layout.fragment_buttom, container);

            改为View view = inflater.inflate(R.layout.fragment_buttom, container, false);  

           查看源码发现

            

    public View inflate(int resource, ViewGroup root) {
            return inflate(resource, root, root != null);
       }

            就可以发现问题了

      

         4.错误

                android.app.SuperNotCalledException: Fragment BottomFragment{52a40288 #0 id=0x7f0c0050} did not call through to super.onActivityCreated()

          分析,它的意思是没有 调用 super.onActivityCreated()  加上就好了

          原因 父类做了许多初始化的操作,没有调用所以不能启动activity

         5.给控件添加点击事件,使用 OnClickListener接口,注意要 用控件etOnClickListener(this);  否则无响应

  • 相关阅读:
    thinkphp中插入ueditor编辑器的代码
    编辑器
    php中上传图片,原生代码
    thinkphp中上传图片以及制成缩略图
    https://www.oschina.net/project/lang/19/java
    js中各种弹窗
    MYSQL数据库中中文乱码问题
    关于对CSS中超链接那部分的设置
    Collectors.groupingBy应用
    定时器算法
  • 原文地址:https://www.cnblogs.com/Free-Wind/p/4616839.html
Copyright © 2011-2022 走看看