@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

解决方法:加上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高效分页解决方案集(转)

    很久以前的一次面试中,被面试官问到这个问题,由于平时用到的分页方法不多,只从索引.分表.使用子查询精准定位偏移以外,没有使用到其它方法. 后来在看其它博客看到了一些不同的方案,也一直没有整理.今天有时 ...

  2. Python多线程学习

    一.Python中的线程使用: Python中使用线程有两种方式:函数或者用类来包装线程对象. 1.  函数式:调用thread模块中的start_new_thread()函数来产生新线程.如下例: ...

  3. 充满想象力的 JavaScript 物理和重力实验

    在这个列表中挑选了9个物理和重力实验,用来展示 Javascript 的强大.几年前,所有这些实验都必须使用 Java 或 Flash 才能做.在下面这些惊人的例子中,就个人而言,我比较喜欢仿真布料的 ...

  4. 给你推荐10款优秀的 HTML5 动画工具

    HTML5 在过去三年快速增长,已经成为 Web 开发人员最喜欢的编程语言之一.强大的编程语言拥有开发更好的网页应用的能力. HTML5 中引入的新技术都非常好,像 Chrome.Firefox.Sa ...

  5. vue安装

     条件:已安装 node&npm 1.安装 cnpm :                      $ npm install -g cnpm --registry=https://regis ...

  6. win7系统下,vs2010一调式,vs就关闭要重启

    进入我的文档 %appdata%\Microsoft\VisualStudio, 将 10.0 重命名.网上找的方法有些问题,可能找这路径很难找到啊. 于是自己 找了找 一般都在当前用户文件夹下 Ap ...

  7. JScript中的条件注释详解(转载自网络)

    JScript中的条件注释详解-转载 这篇文章主要介绍了JScript中的条件注释详解,本文讲解了@cc_on.@if.@set.@_win32.@_win16.@_mac等条件注释语句及可用于条件编 ...

  8. sharepoint 开发相关工具总结

    1.CAML Designer 2013 开发caml用 http://biwug-web.sharepoint.com/SitePages/Caml_designer.aspx 2.SharePoi ...

  9. 请各位帮帮忙:Android LBS应用——CityExplorer (v1.0) 调研

    Hello哇各位亲!! 请各位帮帮忙:Android LBS应用——CityExplorer(V1.0)调研 嗯,这个事情是这样的,要填一个调查问卷,但是问卷中部分问题是关于这个叫做CityExplo ...

  10. NSString和SwiftString的区别和使用场景

    当下Swift项目已经越来越多,可能会经常见到  str as NSString 或者 str as String 字符串在这两者之间的来回切换,因为有些操作用OC字符串比较方便,而有些操作则相反,熟 ...