android-The method findViewById(int) is undefined for the type ContactMainFragment报错
Android 报错 for The is type int method
2023-09-27 14:23:20 时间
@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 adb shell命令大全
- Android中shape属性详解
- 解决Android Studio的卡顿问题
- 2021最新Android中级面试题目汇总解答,持续更新中
- android Unhandled exception type ParseException提示报错
- Android studio 报错 gradel project sync failed Error:Cause: peer not authenticated
- windows7平台android studio新建Android项目,报错
- Android Studio ERROR: x86 emulation currently requires hardware acceleration!报错解决傻瓜教程~
- RK3399 Android 7.1 删除repo后编译报错
- android:报错Unable to install xxx,com.android.ddmlib.InstallException: INSTALL_FAILED_UPDATE_INCOMPATI
- Android禁用截屏
- Android 资源String 格式化特殊处理,%s%s多占位符报错
- IntelliJ IDEA 编写Android Studio插件【基础入门】快速搭建一个Action
- 项目运行报错Error: Static interface methods are only supported starting with Android N (--min-api 24)
- Android studio更新后出现警告:Warning:The `android.dexOptions.incremental` property is deprecated and it has
- 【错误记录】编译 Android 版本的 ijkplayer 报错 ( ./init-android.sh: 第 37 行: cd: android/contrib/: 没有那个文件或目录 )
- 【错误记录】编译 Android 版本的 ijkplayer 报错 ( You must define ANDROID_NDK before starting. | 下载指定版本 NDK )
- 【错误记录】Android Studio 配置 AspectJ 报错 ( all buildscript {} blocks must appear before any plugins {} )
- React Native 控件之 Modal 详解 - Android/iOS 双平台通用
- Android Activity之间的数据传递
- 【错误记录】p7zip 交叉编译 Android 版本 NDK 报错 ( error: case value evaluates to -2 , which cannot be narrowed )