XML : Splash Screen implementation - App is not working in Phone but On emulator it is fine

I am trying to implement Splash before the main screen appears. The app works completely fine on the emulator but when it comes to mobile App is getting crashed after the SplashScreen activity is completed.

SplashScreen.java

      import android.app.Activity;      import android.content.Intent;      import android.os.Bundle;      import android.os.Handler;        public class SplashScreen extends Activity {            private static int SPLASH_TIME_OUT = 3000;            @Override          protected void onCreate(Bundle savedInstanceState) {              super.onCreate(savedInstanceState);              setContentView(R.layout.splashcontent);                new Handler().postDelayed(new Runnable() {                    @Override                  public void run() {                      Intent i = new Intent(SplashScreen.this, MainActivity.class);                      startActivity(i);                          finish();                  }              }, SPLASH_TIME_OUT);          }      }    

AndroidManifest.xml

  <?xml version="1.0" encoding="utf-8"?>  <manifest xmlns:android="http://schemas.android.com/apk/res/android"      package="com.robosoft.ghm">          <application          android:allowBackup="true"          android:icon="@mipmap/ic_launcher"          android:label="@string/app_name"          android:supportsRtl="true"          android:theme="@style/AppTheme">          <!-- SplashActivity -->          <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>            <!-- MainActivity -->          <activity              android:name=".MainActivity"              android:label="@string/app_name" >          </activity>          <!-- SingleItemView -->          <activity android:name=".SingleItemView">          </activity>      </application>    </manifest>    

Logcat:

  01-17 12:05:03.832 2631-2631/? E/memtrack: Couldn't load memtrack module (No such file or directory)  01-17 12:05:03.832 2631-2631/? E/android.os.Debug: failed to load memtrack module: -2  01-17 12:05:18.424 2696-2696/? E/memtrack: Couldn't load memtrack module (No such file or directory)  01-17 12:05:18.424 2696-2696/? E/android.os.Debug: failed to load memtrack module: -2  01-17 12:06:29.183 1539-1539/? E/EGL_emulation: tid 1539: eglCreateSyncKHR(1181): error 0x3004 (EGL_BAD_ATTRIBUTE)  01-17 12:06:44.394 1539-1539/? E/EGL_emulation: tid 1539: eglCreateSyncKHR(1181): error 0x3004 (EGL_BAD_ATTRIBUTE)    

No comments:

Post a Comment