Error in Android Studio - "Default Activity Not Found"

时间:2022-04-14 15:55:30

Make sure you have specified the default activity in your AndroidManisfest.xml file. Within your default activity's xml<activity> section, there should be these tags:

            <intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

        <activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

这样就会把 MainActivity 这个Activity设置为默认。

程序猿必读