今天忙活了一下午,仅仅弄出了这一个东西,关键还是对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; //延迟三秒
@Override
public 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();
}
}