2017-09-29 1 views
0

Ich habe die gleiche Frage an dieser Stelle gefunden, aber die Antworten funktionierten nicht für mich (es funktioniert, wenn ich das tue: Wählen Sie Menü Run -> Edit Configurations).Fehler beim Ausführen der App: Standardaktivität nicht gefunden (Android)

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="es.package.launcher"> 
<application> 
    <activity 
     android:name=".HomeActivity" 
     android:label="Launcher" 
     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> 
    </activity> 
    <activity 
     android:name=".AppsListActivity" 
     android:theme="@android:style/Theme.NoTitleBar.Fullscreen"></activity> 
</application> 

schreibe ich etwas falsch gemacht? Bitte zeig mich.

+0

Sie haben vergessen, den Launcher-Filter zu Intent hinzuzufügen. –

Antwort

2

Sie Hinzufügen in Ihrem Intent-Filter sind nicht <category android:name="android.intent.category.LAUNCHER" /> im activity Tag hinzuzufügen

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

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

fehlt Sie <category android:name="android.intent.category.LAUNCHER" />

+0

Bitte akzeptieren Sie diese Antwort, so ist es hilfreich für andere @ChenYo –

1
Code ändern

Code unten mit. Sie müssen in Ihrer Manifest-Datei

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="es.package.launcher"> 
<application> 
    <activity 
     android:name=".HomeActivity" 
     android:label="Launcher" 
     android:theme="@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen" 
     android:launchMode="singleTask" 
     android:stateNotNeeded="true"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      //Add this line 
      <category android:name="android.intent.category.LAUNCHER" /> 
      <category android:name="android.intent.category.HOME" /> 
      <category android:name="android.intent.category.DEFAULT" /> 
     </intent-filter> 
    </activity> 
    <activity 
     android:name=".AppsListActivity" 
     android:theme="@android:style/Theme.NoTitleBar.Fullscreen"></activity> 
</application> 
2

hinzufügen unten Zeile in der Intent-Filter

<category android:name="android.intent.category.LAUNCHER" /> 

<intent-filter> 
     <action android:name="android.intent.action.MAIN" /> 
     <category android:name="android.intent.category.HOME" /> 
     <category android:name="android.intent.category.DEFAULT" /> 
     **<category android:name="android.intent.category.LAUNCHER" />** 
    </intent-filter> 
Verwandte Themen