Android入门(6)程序启动画面

来源:互联网 发布:网络优化工程师证书 编辑:程序博客网 时间:2024/06/03 17:23

今天忙活了一下午,仅仅弄出了这一个东西,关键还是对Java里的线程不熟悉。

要做深入的开发的话,Java还得重新看一遍。

代码很简单,两个Activity,一个Handler,一个intent。

package com.example.gtd;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.widget.ImageView;import android.widget.TextView;public class SplashScreen extends Activity {private ImageView logoView;private TextView rightView;private final int SPLASH_DISPLAY_LENGHT = 3000; //延迟三秒 @Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.splash_screen);logoView=(ImageView)findViewById(R.id.imageView1);rightView=(TextView)findViewById(R.id.textView1);//logoView.setAlpha(alpha);new Handler().postDelayed(new Runnable(){          @Override          public void run() {              Intent mainIntent = new Intent(SplashScreen.this, GTD.class);              SplashScreen.this.startActivity(mainIntent);              SplashScreen.this.finish();          }                     }, SPLASH_DISPLAY_LENGHT); //updateThread.run();}}


原创粉丝点击