2017-07-28 26 views
0

私は....スプラッシュ画面が任意のアイデア 活動スプラッシュ画面は、Androidマニフェスト

のAndroidManifest.xml

で宣言されていない活動が、それは私が怒っ駆動だと言う私のアプリを実行しようとしたときにエラーを取得維持で宣言されていません! :-)

<?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

まだ解決されていますか?そうでない場合、私は質問に自分の答えを掲示します。 – UmarZaii

+0

並べ替えメインビットを削除した後も同じエラーが表示されますが、アプリケーションタグを追加する方法を検討する必要がありますか?どこに追加するか、追加する場所はどこですか? – gareth19822002

答えて

0

SJMPlanningHomeからタグを削除します。あなたはMAINとして2つの活動を宣言しました。

+0

Doh。それは私の基本的な愚かなエラーでした。あなたは他のページを何と宣言しているのですか、あるいは単に行全体を削除していますか? – gareth19822002

+0

行全体を削除します。しかし、あなたはまた、タグを紛失しています... –

+0

非常に感謝クール – gareth19822002

0

それぞれのアンドロイドアプリケーションは、マニフェストのメインタグとして "アプリケーション"タグを定義する必要があります。次に、アプリケーション内でアクティビティを定義します。ここでは、マニフェストの構造がある:あなたがここにも確認することができます。すべての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

まず、あなたはapplicationタグが欠落しています。あなたは

android:allowBackup="true" 

前にタグを配置する必要がありますし、

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

秒後、あなたはSJMPlanningHomeのための意図を濾過した後activityを閉じるのを忘れていました。

これは完全なコードです。

<?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

非常にありがとう! :-) :-) – gareth19822002

関連する問題