2017-07-28 6 views
0

Ich halte einen Fehler, wenn ich versuche meine App zu laufen, das sagt .... Die Aktivität Splashscreen ist nicht in AndroidManifest.xml erklärtAktivität Splashscreen ist nicht im Android Manifest erklärt

Alle Ideen, es macht mich verrückt! :-)

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.example.sjmplanningfinal"> 

    android:allowBackup="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:roundIcon="@mipmap/ic_launcher_round" 
    android:supportsRtl="true" 
    android:theme="@android:style/Theme.Holo.Light"> 

    <activity android:name="com.example.sjmplanningfinal.SplashScreen"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
    <activity android:name="com.example.sjmplanningfinal.SJMPlanningHome" /> 
    <intent-filter> 
     <action android:name="android.intent.action.MAIN" /> 
     <category android:name="android.intent.category.DEFAULT" /> 
    </intent-filter> 
+0

Ist es schon gelöst? Wenn nicht, werde ich meine Antwort auf die Frage posten. – UmarZaii

+0

Sortieren von. Ich bekomme immer noch den gleichen Fehler, nachdem ich das Main-Bit entfernt habe, aber jetzt muss ich herausfinden, wie man das Application-Tag hinzufügt. Oder wo es hinzuzufügen oder was hinzuzufügen? – gareth19822002

Antwort

0

den Tag action android:name="android.intent.action.MAIN von SJMPlanningHome entfernen. Sie haben zwei Aktivitäten als MAIN deklariert.

+0

Doh. Das war ein grundlegender, dummer Fehler von meiner Seite. Was deklarieren Sie andere Seiten als oder entfernen Sie nur die gesamte Zeile? – gareth19822002

+0

Entfernen Sie die gesamte Zeile. Aber Sie fehlen auch die Tag ... –

+0

Cool Vielen Dank – gareth19822002

0

Jede Android-Anwendung sollte definiert haben "Anwendung" -Tag .. als Haupt-Tag in Manifest .. und dann in Anwendung definieren Sie Aktivitäten. Hier Struktur manifestiert: Sie können prüfen, auch hier: Manifest structure

<?xml version="1.0" encoding="UTF-8"?> 
<manifest> 
    <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> 
    </application> 
</manifest> 
1
<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.example.sjmplanningfinal"> 
    <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="@android:style/Theme.Holo.Light"> 

    <activity android:name="com.example.sjmplanningfinal.SplashScreen"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
    <activity android:name="com.example.sjmplanningfinal.SJMPlanningHome" /> 
    <intent-filter> 
     <action android:name="android.intent.action.MAIN" /> 
     <category android:name="android.intent.category.DEFAULT" /> 
    </intent-filter> </application> 

</manifest> 
0

Zu allererst Sie fehlt den application-Tag. Sie haben den Tag zu legen, bevor

android:allowBackup="true" 

und nach

<activity android:name="com.example.sjmplanningfinal.SJMPlanningHome"> 

Zweitens vergessen haben activity nach Filterung der Absicht für SJMPlanningHome zu schließen.

Dies ist der vollständige Code.

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.example.sjmplanningfinal"> 

    <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="@android:style/Theme.Holo.Light"> 

     <activity android:name="com.example.sjmplanningfinal.SplashScreen"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
     <activity android:name="com.example.sjmplanningfinal.SJMPlanningHome"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 
     </activity> 
    </application> 

</manifest> 
+0

Ausgezeichnet Vielen Dank! :-) :-) – gareth19822002

Verwandte Themen