码迷,mamicode.com
首页 > 移动开发 > 详细

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

时间:2014-10-30 19:06:43      阅读:231      评论:0      收藏:0      [点我收藏+]

标签:android   style   blog   http   color   for   sp   div   on   

 

    @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

bubuko.com,布布扣

解决方法:加上view.即可

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

 

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

标签:android   style   blog   http   color   for   sp   div   on   

原文地址:http://www.cnblogs.com/jenson138/p/4063248.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!