运行时出现错误,模拟器无法运行

来源:4-1 自定义内部类方式

日落长安归

2021-08-08 13:03:11

http://img.mukewang.com/climg/610f654609e0e41819191029.jpg

http://img.mukewang.com/climg/610f656809efc81f19191029.jpg

​<?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

  1. 不可运行是因为项目存在error 尚未解决

  2. 截图蓝框处的提示 即为错误内容

  3. 错误修复方式为打开Manifest.xml ,需要把你的TestActivity注册进去,并配以intent-filter

  4. ​基础课程的学习也可参考:https://www.songyubao.com/book/primary/

0

0 学习 · 2907 问题

查看课程