运行时出现错误,模拟器无法运行
来源:4-1 自定义内部类方式
日落长安归
2021-08-08 13:03:11


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ButtonActivity"
android:orientation="vertical"
android:exported="true"
>
<Button
android:id="@+id/btn1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="通过自定义内部类实现点击事件"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="通过匿名内部类实现点击事件"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="通过当前Activity去实现点击事件"/>
</LinearLayout>
运行时出现如上图错误,究竟是为什么?
1回答
LovelyChubby
2021-08-08
不可运行是因为项目存在error 尚未解决
截图蓝框处的提示 即为错误内容
错误修复方式为打开Manifest.xml ,需要把你的TestActivity注册进去,并配以intent-filter
基础课程的学习也可参考:https://www.songyubao.com/book/primary/
相似问题