zoukankan      html  css  js  c++  java
  • Android欢迎界面

    package edu.hpu.init;
    
    import android.app.Activity;
    
    import android.content.Intent;
    
    import android.os.Bundle;
    
    import android.os.Handler;
    
    import edu.hpu.logic.R;
    
    import edu.hpu.viewpager.MyViewPagerActivity;
    
    public class StartActivity extends Activity {
    
    	//延迟1秒 
    
        private static final long delayTime = 1000;
    
        @Override
    
        protected void onCreate(Bundle savedInstanceState) {
    
            super.onCreate(savedInstanceState);
    
            setContentView(R.layout.splash);
    
            // 使用Handler的postDelayed方法,3秒后执行跳转 
    
            new Handler().postDelayed(new Runnable() {
    
            	//必须加上StartActivity,否则默认是该Runable接口
    
                public void run() {
    
                	goHome();
    
                }
    
            }, delayTime);
    
            
    
        }
    
        private void goHome() {
    
    		Intent intent = new Intent(this, MyViewPagerActivity.class);
    
    		startActivity(intent);
    
    		this.finish();
    
    	}
    
    }
    

    <!-- 欢迎界面 -->
    
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    
        xmlns:tools="http://schemas.android.com/tools"
    
        android:layout_width="match_parent"
    
        android:layout_height="match_parent"
    
        tools:context=".StartActivity" >
    
        <ImageView
    
            android:layout_width="match_parent"
    
            android:layout_height="match_parent"
    
            android:adjustViewBounds="true"
    
            android:background="@drawable/logo"
    
            android:scaleType="centerCrop" />
    
    </RelativeLayout>
  • 相关阅读:
    poj3984 迷宫问题(简单搜索+记录路径)
    substr
    poj3087 Shuffle'm Up
    学生管理系统
    win10配置gcc编译环境
    poj3278 Catch That Cow
    将字符串str1复制为字符串str2的三种解决方法
    poj2251 Dungeon Master
    cf 410
    7.20 Codeforces Beta Round #8
  • 原文地址:https://www.cnblogs.com/hxsyl/p/3723992.html
Copyright © 2011-2022 走看看