android - How to remove Activity layout flickers when switching from full screen activity to normal activity(with Action Bar)? -


i using splash screen of full screen size no action bar layout when move login activity normal activity having action bar layout not move smoothly shows flickers(up/down).i not getting on please ...

i using intent pass action splash activity login activity

this code of splash screen:

public void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         setcontentview(r.layout.splash);         /* set time splash out */         final int welcomescreendisplay = 4000;         /* create thread show splash splash time */         thread welcomethread = new thread() {             int wait = 0;              @override             public void run() {                 try {                     super.run();                     /*                      * use while splash time. use sleep() increase                      * wait variable every 100l.                      */                     while (wait < welcomescreendisplay) {                         sleep(100);                         wait += 100;                     }                 } catch (exception e) {                     system.out.println("exc=" + e);                 } {                     /*                      * called after splash times up. action after splash                      * times up. here moved main activity class                      */                     startactivity(new intent(splashactivity.this,                             loginactivity.class));                     finish();                 }             }         };         welcomethread.start();     } } 

use instead create delay

/** duration of wait **/     private final int splash_display_length = 1000;      /** called when activity first created. */     @override     public void oncreate(bundle icicle) {         super.oncreate(icicle);         setcontentview(r.layout.splashscreen);          /* new handler start menu-activity           * , close splash-screen after seconds.*/         new handler().postdelayed(new runnable(){             @override             public void run() {                 /* create intent start menu-activity. */                 intent mainintent = new intent(splash.this,menu.class);                 splash.this.startactivity(mainintent);                 splash.this.finish();             }         }, splash_display_length);     } 

Comments