android-The method findViewById(int) is undefined for the type ContactMainFragment报错

时间:2022-09-29 21:56:06
    @Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState); mTitleNameView = (TextView) findViewById(R.id.ivTitleName);
mTitleNameView.setVisibility(View.VISIBLE);
mTitleNameView.setText(R.string.company_name);

提示:意思应该是提示找不到相应组件而得不到组件ID

android-The method findViewById(int) is undefined for the type ContactMainFragment报错

解决方法:加上view.即可

mTitleNameView = (TextView) view.findViewById(R.id.ivTitleName);

android-The method findViewById(int) is undefined for the type ContactMainFragment报错的更多相关文章

  1. Android NDK 【错误】The method loadLibrary(String) is undefined for the type Settings.Syste

    [错误]The method loadLibrary(String) is undefined for the type Settings.System [解决方法] 不要加入包import andr ...

  2. The method replace(int, Fragment, String) in the type FragmentTransaction is not applicable for the arguments (int, SettingFragment, String)

    The method replace(int, Fragment, String) in the type FragmentTransaction is not applicable for the ...

  3. The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

    The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory 这是由于项目里面的一些 ...

  4. The method setPositiveButton(int, DialogInterface.OnClickListener) in the type AlertDialog.Builder is not applicable for the arguments

    The method setPositiveButton(int, DialogInterface.OnClickListener) in the type AlertDialog.Builder i ...

  5. The method getJspApplicationContext(ServletContext) is undefined for the type

    type Exception report message Unable to compile class for JSP: description The server encountered an ...

  6. 报错:An error occurred at line: 22 in the generated java file The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

    org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 22 in ...

  7. The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的解决方法

    An error occurred at line: [31] in the generated java file: [/data/tmisnt/work/Catalina/localhost/_/ ...

  8. The method setCharacterEncoding(String) is undefined for the type HttpServletResponse

    今天将以前做的一个web项目从不笔记本上移到台式机上,import项目后出现“The method setCharacterEncoding(String) is undefined for the ...

  9. The method setPositiveButton(int, DialogInterface.OnClickListener) in the type AlertDialog.Builder i

    参考资料: http://blog.csdn.net/competerh_programing/article/details/7377950 在创建Dialog的时候,出现: The method ...

随机推荐

  1. mysql列类型

    mysql三大列类型 整型 tinyint(占据空间:1个字节 存储范围  有符号  -128-127   无符号  0-255) smallint   mediumint    int    big ...

  2. JSTL标签使用说明

    使用jstl需进行以下操作 a.下载jstl. b.解压jar文件将jstl.jar和standard.jar文件放到项目lib文件夹. c.在需要使用jstl地方引用标签库,比如在jsp页面引用以下 ...

  3. jpa+spring配置多数据源

    property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/test?useU ...

  4. SwapEffect 枚举(定义交换效果)

    由于创建设备时要用到这个值,所以在这里总结一下,以免以后再找. 首先引自msdn: Copy 只能为构成单个后台缓冲区的交换链指定此交换效果. 无论交换链是有窗口的还是全屏的,运行库都保证 Devic ...

  5. SQL打印全年日历

    数据库环境:SQL SERVER 2008R2 我之前有写过打印本月日历的SQL,里头有详细的说明.具体请参考前面的博文——生成本月日历. 全年日历只是在本月日历的基础上加了月信息,并按月份分组求得. ...

  6. 【Algorithm】逆序数的分治求解

    逆序数的分治求解,时间复杂度O(nlgn).基本思想是在归并排序的基础上加逆序计数. #include <iostream> #include <cstdio> #includ ...

  7. 用powershell实现:&OpenCurlyDoubleQuote;倩女幽魂姥姥”版《语音报警系统》

    ------[第一章 前言]------ win7,及以上版本中,是自带语音库的,系统自带一套女声中文库,一套女声英文库.用powershell调用,从而发音,制作报警系统.是一件太简单的事情,只需要 ...

  8. Python的安装图解

    安装步骤: 第一步:打开Python官网:http://www.python.org 第二步:点击Download,下载windows版本 第三步:选择要下载的版本第四步:安装到指定的位置第五步:验证 ...

  9. &lt&semi;python3-cookbook&gt&semi;第一章:数据结构和算法

    第一章:数据结构和算法 介绍:python3-cookbook这本书是高级用法,不是小白使用书目的:写作目的是记录下自己学习这本书的过程以及收获书籍地址:https://python3-cookboo ...

  10. linux 查找并kill进程

    以php以关键字查找进程 $ ps aux | grep php root             32957   0.0  0.1  2470904   8908 s002  S+    4:53下 ...