现在的位置: 首页 > 综合 > 正文

android 启动页 实现

2013年12月11日 ⁄ 综合 ⁄ 共 921字 ⁄ 字号 评论关闭

转自: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 {
@Override
protected void onCreate(Bundle savedInstanceState) {
	// TODO Auto-generated method stub
	super.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  {
	@Override
	public void run() {
		Intent intent =new Intent(StartPage.this, Main.class);
		StartPage.this.startActivity(intent);
		StartPage.this.finish();
		
	}
}
}

 

抱歉!评论已关闭.