前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Default Activity Not Found

Default Activity Not Found

作者头像
凌川江雪
发布2019-06-14 10:37:14
1.7K0
发布2019-06-14 10:37:14
举报
文章被收录于专栏:李蔚蓬的专栏

方才遇到如标题所述的bug, 也就是点击运行按钮时,AS左下角弹出红色背景对话框, 提示“ Default Activity Not Found ” 基于此篇文章:Default Activity Not Found 问题总结 问题没有得到解决; 自行研究数分钟, 发现不过是xml布局文件中注释了组件的原因:

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.cniao5.cniao5retrofitdemo.MainActivity">

      <Button android:id="@+id/get"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:text="点我啊"

          android:onClick="requestAPI"/>


        <!--<Button-->
                  <!--android:layout_height="wrap_content"-->
                  <!--android:layout_width="wrap_content"-->
                  <!--android:text="登录"-->
            <!--android:onClick="login"/>-->

    <!--<Button-->
                  <!--android:layout_height="wrap_content"-->
                  <!--android:layout_width="wrap_content"-->
                  <!--android:text="使用RxJava登录"-->
            <!--android:onClick="loginWithRxJava"/>-->
          

</LinearLayout>

把注释剪切出来另存到别的地方, 再重启AS问题即可解决。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019.06.08 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档