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>
  • 相关阅读:
    解除对80端口的占用
    php排序算法
    Jquery异步请求数据实例
    C# winform 递归选中TreeView子节点
    C# WinFrom 编写正则表达式验证类
    c# winfrom 委托实现窗体相互传值
    [转]我的第一个WCF
    计算字符串中子串出现的次数
    JQuery中的html(),text(),val()区别
    Crystal Report制作使用
  • 原文地址:https://www.cnblogs.com/hxsyl/p/3723992.html
Copyright © 2011-2022 走看看