Reputation: 7
I am making a basic custom launcher by following the given instructions on a site... The instructions say that the app can be launched, but when I try, I get an error saying the default activity not found.
I looked into the existing questions on stack overflow but none of them helped me. My manifest is this...
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="omg_its_azzler.launcher">
<activty>
<application android:allowBackup="true"
android:name="omg_its_azzler.launcher.HomeActivity"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"
android:launchMode="singleTask"
android:stateNotNeeded="true"/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activty>
<activity>
android:name="omg_its_azzler.launcher.AppsActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
</activity>
</manifest>
Upvotes: 0
Views: 135
Reputation: 663
All <activity>...</activity>
should be in <application>...</application>
.
In your manifest your <activity>
tag is outside the <application>...</application>
and closing tag </activity>
is inside it.
This is the AndroidManifest.xml
structure:
<uses-permission />
<permission />
<permission-tree />
<permission-group />
<instrumentation />
<uses-sdk />
<uses-configuration />
<uses-feature />
<supports-screens />
<compatible-screens />
<supports-gl-texture />
<application>
<activity>
<intent-filter>
<action />
<category />
<data />
</intent-filter>
<meta-data />
</activity>
<activity-alias>
<intent-filter> . . . </intent-filter>
<meta-data />
</activity-alias>
<service>
<intent-filter> . . . </intent-filter>
<meta-data/>
</service>
<receiver>
<intent-filter> . . . </intent-filter>
<meta-data />
</receiver>
<provider>
<grant-uri-permission />
<meta-data />
<path-permission />
</provider>
<uses-library />
</application>
Upvotes: 0
Reputation: 28228
You got the syntax of the manifest wrong. The application tag is the tag you keep all the activities inside of.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="omg_its_azzler.launcher">
<application android:allowBackup="true"
android:name="omg_its_azzler.launcher.HomeActivity"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"
android:launchMode="singleTask"
android:stateNotNeeded="true"/>
<activity>
android:name="omg_its_azzler.launcher.AppsActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
The application tag is the root tag for all activities, and the intent filter goes inside the activity tag
Upvotes: 1