Android Studio:Error running app: Default Activity Not Found
遇到该问题的具体情节为:在学习《第一行代码》第2版的第2章2.2节活动的基本用法时,最后运行程序,就出现了这一问题。
(1)于是首先想到检查AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hbu.activitytest">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".FirstActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
(2)确定没有错误,之后通过上网查询,解决方法如下所示:
此时重新运行,可虽然解决了Error running app: Default Activity Not Found的问题,即没有报错,但其实没有什么实际用处。
(3)再然后继续在网上查找,第二个方法如下所示:
呵呵!好像还是不行(有点无奈)。
(4)最后的最后,一套组合拳下来,好吧!关闭Android Studio之后重新启动运行项目就好了(莫名其妙的)。