I have two activities: Main and Splash. My goal is to show Splash activity for 5 secs and then start Main activity. When I start Splash activity on my computer's emulator everything is okay. When the running device is my phone Nexus 5 (plugged to computer) the phone shows a little bit (2 - 3 secs) of Splash activity, then turn into home screen, then (after 2 - 3 secs) starts Main activity. When I install app on my phone with apk file, everything works fine. My Main class doesn't have anything special. I'm using Android Studio if that matters. My Splash screen is just ordinary image. My Splash activity:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Thread timer = new Thread() {
public void run() {
try {
sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
startActivity(new Intent("com.example.app.MAIN"));
}
}
};
timer.start();
}
@Override
protected void onPause() {
super.onPause();
finish();
}
LogCat:
04-27 16:59:34.655 2502-2502/? I/Crashlytics﹕ Initializing Crashlytics 1.1.10.12
04-27 16:59:34.735 2502-2506/? D/dalvikvm﹕ GC_CONCURRENT freed 316K, 3% free 16924K/17272K, paused 12ms+5ms, total 34ms
04-27 16:59:34.735 2502-2523/? D/dalvikvm﹕ WAIT_FOR_CONCURRENT_GC blocked 12ms
04-27 16:59:34.735 2502-2516/? D/dalvikvm﹕ WAIT_FOR_CONCURRENT_GC blocked 12ms
04-27 16:59:34.745 2502-2502/? E/OpenUDID﹕ Initialisation isn't done
04-27 16:59:34.775 2502-2506/? D/dalvikvm﹕ GC_CONCURRENT freed 444K, 3% free 16992K/17468K, paused 2ms+2ms, total 20ms
04-27 16:59:34.775 2502-2515/? D/dalvikvm﹕ WAIT_FOR_CONCURRENT_GC blocked 4ms
04-27 16:59:34.785 2502-2502/? D/dalvikvm﹕ WAIT_FOR_CONCURRENT_GC blocked 5ms
04-27 16:59:34.785 2502-2530/? D/dalvikvm﹕ WAIT_FOR_CONCURRENT_GC blocked 5ms
04-27 16:59:34.785 761-809/? I/ActivityManager﹕ Killing 2332:com.android.providers.calendar/u0a1 (adj 15): empty #17
04-27 16:59:34.835 2502-2502/? V/AmazonInsightsSDK﹕ Firing Session Event: _session.start
04-27 16:59:34.835 2502-2502/? I/AmazonInsightsSDK﹕ Amazon Insights SDK(2.1.16.0) initialization successfully completed
04-27 16:59:34.845 2502-2536/? I/AmazonInsightsSDK﹕ Attempting to retrieve variation(s) for project(s):'Sponsored in feed'
04-27 16:59:34.865 2502-2506/? D/dalvikvm﹕ GC_CONCURRENT freed 462K, 3% free 17024K/17516K, paused 3ms+3ms, total 30ms