android - tools:context=".MainActivity" 失败,我该如何解决?
问题描述
论点:tools:context=".MainActivity"
给我错误,另外命名的部分:.MainActivity
以红色显示,我该怎么办?
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
解决方案
尝试重建项目或尝试使缓存重新启动无效
如果仍然有同样的问题,您可以添加 yourpackagename.mainactivity 就像图片中这样
tools:context="com.etest.myapplicwr.MainActivity">
我的包名称是 com.etest.myapplicwr 用你的包名称替换它
推荐阅读
- php - 垃圾收集器是否可以收集属于处于 `sleep()` 条件下的脚本的元素?
- linker - 无法在 BPL 中找到未解析的外部/过程入口点
- reactjs - 模态打开时反应键盘事件未触发
- yii2 - 在 Yii2 中的 DetailView::widget 上打开图片
- python - 如何使用 xlwings 在 Excel 中复制和粘贴筛选表
- java - mockMvc,从 SpringBoot 中的 json 文件中获取内容
- python-3.x - 如何在python中将我的sql结果转换为以下字典格式?
- c# - WPF Material Design ComboBox Flyout问题
- laravel - 在 laravel 5.1 中全局注册自定义构建器
- azure - Azure 媒体服务 - 客户端上设置的自定义转换丢失?