欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android啟動(dòng)畫面的實(shí)現(xiàn)方法

 更新時(shí)間:2015年01月19日 14:39:10   投稿:shichen2014  
這篇文章主要介紹了Android啟動(dòng)畫面的實(shí)現(xiàn)方法,分析了布局文件及加載啟動(dòng)文件的實(shí)現(xiàn)方法,非常具有實(shí)用價(jià)值,需要的朋友可以參考下

本文實(shí)例講述了Android啟動(dòng)畫面的實(shí)現(xiàn)方法。分享給大家供大家參考。具體分析如下:

在應(yīng)用程序中經(jīng)常用到啟動(dòng)畫面,會(huì)啟動(dòng)一個(gè)后臺(tái)線程為主程序的運(yùn)行準(zhǔn)備資源。
Android要實(shí)現(xiàn)啟動(dòng)畫面可以這樣做:

這是splash.xml布局文件的代碼:

復(fù)制代碼 代碼如下:
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical">
<ImageView android:layout_height="fill_parent" android:layout_width="fill_parent" android:scaleType="fitCenter" android:src="@drawable/splash"></ImageView>
</LinearLayout>

放一個(gè)ImageView加載啟動(dòng)畫面圖片
SplashActivity作為主視圖啟動(dòng):

復(fù)制代碼 代碼如下:
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);
        Handler x = new Handler();
        x.postDelayed(new splashhandler(), 2000);
       
}
class splashhandler implements Runnable{
        public void run() {
            startActivity(new Intent(getApplication(),MainActivity.class));
            SplashActivity.this.finish();
        }
}

希望本文所述對(duì)大家的Android程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論