2012-05-17 14 views
1

我的應用程序需要大約3秒的時間才能加載(有很多改進空間)。在用戶進入我的進入活動之前,我會看到一個空白的白色屏幕。是否有可能在那裏扔一個位圖,所以它看起來不那麼可怕?我想我記得讀書的地方,你可以在實際應用仍然被啓動這裏通過使用樣式呈現的東西,入口點活動加載時存在位圖嗎?

感謝

+0

嘗試添加一個啓動屏幕,它會顯示,直到你的應用程序加載 – user1203673

回答

0

,我只想展示與ImageView的啓動畫面。

像這樣在onCreate

setContentView(mySplashImageView); 
asyncTaskExecutor.runInBackground(new Runnable(){ 
    public void run(){ 
     // something that takes a long time to finish 
     ..... CODE .... 
     // when the heavy code above finished, use a handler or something to notify your UI thread to swap its main content view. 
    } 
}); 

在接收該重編碼完成的通知時,簡單地復位主要內容視圖。

setContentView(R.layout.mainScreen); 
相關問題