首页 > 代码库 > Error in Android Studio - "Default Activity Not Found"

Error in Android Studio - "Default Activity Not Found"

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设置为默认。

Error in Android Studio - "Default Activity Not Found"