2017-06-08 1 views
0

pls tout corps me aider ... je veux ajouter splashscreen tp mon application Android en utilisant ce tutoriel: http://www.androidhive.info/2013/07/how-to-implement-android-splash-screen-2/écran d'accueil images de charge android problèmes dans la page principale

, mes aps construit avec Eclipse, cordova, jquery mobile . dernière fois avant d'ajouter l'écran de démarrage, toutes les images de la page principale (index.html) chargées avec succès, mais où j'ai mis en place l'écran de démarrage, les images de ma page principale n'est pas chargée.

ceci est mon manifest.xml

<activity 
      android:name=".SplashScreen" 
      android:label="@string/app_name" 
      android:screenOrientation="portrait" 
      android:theme="@android:style/Theme.Black.NoTitleBar" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

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

     <activity 
      android:name=".MainActivity" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

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

splashscreen.java

package com.example.package; 

import android.app.Activity; 
import android.content.Intent; 
import android.os.Bundle; 
import android.os.Handler; 

public class SplashScreen extends Activity { 

    // Splash screen timer 
    private static int SPLASH_TIME_OUT = 6000; 

    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_splash); 

     new Handler().postDelayed(new Runnable() { 

      /* 
      * Showing splash screen with a timer. This will be useful when you 
      * want to show case your app logo/company 
      */ 

      @Override 
      public void run() { 
       // This method will be executed once the timer is over 
       // Start your app main activity 
       Intent i = new Intent(SplashScreen.this, MainActivity.class); 
       startActivity(i); 

       // close this activity 
       finish(); 
      } 
     }, SPLASH_TIME_OUT); 
    } 

} 

activity_splash.xml

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@drawable/lcr" > 

    <ImageView 
     android:id="@+id/imgLogo" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerInParent="true" 
     android:src="@drawable/w_logo" /> 

    <TextView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginBottom="10dp" 
     android:textSize="12dp" 
     android:textColor="#454545" 
     android:gravity="center_horizontal" 
     android:layout_alignParentBottom="true" 
     android:text="www.androidhive.info" /> 

</RelativeLayout> 
+0

vous avez déclaré propriété LAUNCHER à plus d'une activité, il devrait être seulement SplashActivity – Omi

Répondre

0
problème

avec votre fichier Manifest essayez le code ci-dessus

<activity 
     android:name=".SplashScreen" 
     android:label="@string/app_name" 
     android:screenOrientation="portrait" 
     android:theme="@android:style/Theme.Black.NoTitleBar" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

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

    <activity 
     android:name=".MainActivity"/> 
+0

wow ... merci ... comment ça me manque .. – Def