android - Splash screen displays white screen and then black before it sets the menu page -


my app has splash screen animated logo(using thread) , menu page displayed.

now want background activity in splash screen. want convert images string etc.

i have placed code in oncreate() function. problem instead of splash screen see blank white screen , black screen. after sometime menu page displayed usual.

if comment code of background processing functions perfectly. background code working correctly. not working together. there no errors in logcat , unable know wrong.

please help. urgent... thanks.

java code of splash screen

public class splash extends activity {  protected int _splashtime = 10000;   private thread splashtread;  /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     //makefolder();      this.requestwindowfeature(window.feature_no_title);     //remove notification bar     this.getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen);     setcontentview(r.layout.splash);           makefolder();        imageview im =(imageview)findviewbyid(r.id.imageview2);      final animation mobianim = animationutils.loadanimation(this, r.anim.mobianim);      im.setanimation(mobianim);     mobianim.setduration(1000);      animate();   //  animatelogo();        final splash splashscreen = this;       // thread displaying splashscreen     splashtread = new thread() {         @override         public void run() {             try {                                    synchronized(this){                     wait(_splashtime);                  }               } catch(interruptedexception e) {}              {                 finish();                  intent = new intent();                 i.setclass(splashscreen, menupg.class);                 startactivity(i);                  // stop();             }         }     };      splashtread.start();          /*                **code doing background things**         */  }  public void makefolder(){     file direct = new file(environment.getexternalstoragedirectory() + "/myfolder");      if(!direct.exists())      {          if(direct.mkdir()){ //directory created;       }     }     }  @override public boolean ontouchevent(motionevent event) {     if (event.getaction() == motionevent.action_down) {         synchronized(splashtread){             splashtread.notifyall();         }     }     return true; }   public void animate(){         imageview iv1=(imageview)findviewbyid(r.id.imageview1);           alphaanimation alphaamin = new alphaanimation(0,1);         iv1.setanimation(alphaamin);         alphaamin.setduration(5000);  } } 

is code doing background things running in thread or part of ui thread?
because animation wont shown until oncreate method finishes, be.

also use startanimation(animation) on imageviews start in moment.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -