android 启动页 实现

来源:互联网 发布:仓管王软件 编辑:程序博客网 时间:2024/06/15 12:32

转自:http://www.cnblogs.com/dawei/archive/2010/04/29/1724044.html

 

实现思路,

启动页显示图片,

利用handler将一个线程放入对列中。 线程跳转到另一个activity中去。

 

package com.AlleMedia.zjhf;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.os.Handler;import android.view.ViewGroup.LayoutParams;import android.view.animation.Animation;import android.widget.ImageView;public class StartPage extends Activity {@Overrideprotected void onCreate(Bundle savedInstanceState) {// TODO Auto-generated method stubsuper.onCreate(savedInstanceState);ImageView iv=new ImageView(this);iv.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));iv.setImageResource(R.drawable.startpage);setContentView(iv);new Handler().postDelayed(new myThread(), 3000);}public class myThread implements Runnable  {@Overridepublic void run() {Intent intent =new Intent(StartPage.this, Main.class);StartPage.this.startActivity(intent);StartPage.this.finish();}}}


 

原创粉丝点击