zoukankan      html  css  js  c++  java
  • android启动界面

    /**
     * 应用程序启动类:显示欢迎界面并跳转到主界面
     * <a href="http://my.oschina.net/arthor" target="_blank" rel="nofollow">@author</a>  liux (http://my.oschina.net/liux)
     * @version 1.0
     * @created 2012-3-21
     */
    public class AppStart extends Activity {
         
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            final View view = View.inflate(this, R.layout.start, null);
            setContentView(view);
             
            //渐变展示启动屏
            AlphaAnimation aa = new AlphaAnimation(0.3f,1.0f);
            aa.setDuration(2000);
            view.startAnimation(aa);
            aa.setAnimationListener(new AnimationListener()
            {
                @Override
                public void onAnimationEnd(Animation arg0) {
                    redirectTo();
                }
                @Override
                public void onAnimationRepeat(Animation animation) {}
                @Override
                public void onAnimationStart(Animation animation) {}
                 
            });
             
            //兼容低版本cookie(1.5版本以下,包括1.5.0,1.5.1)
            AppContext appContext = (AppContext)getApplication();
            String cookie = appContext.getProperty("cookie");
            if(StringUtils.isEmpty(cookie)) {
                String cookie_name = appContext.getProperty("cookie_name");
                String cookie_value = appContext.getProperty("cookie_value");
                if(!StringUtils.isEmpty(cookie_name) && !StringUtils.isEmpty(cookie_value)) {
                    cookie = cookie_name + "=" + cookie_value;
                    appContext.setProperty("cookie", cookie);
                    appContext.removeProperty("cookie_domain","cookie_name","cookie_value","cookie_version","cookie_path");
                }
            }
        }
         
        /**
         * 跳转到...
         */
        private void redirectTo(){       
            Intent intent = new Intent(this, Main.class);
            startActivity(intent);
            finish();
        }
  • 相关阅读:
    asp.net 中的viewstate用法?
    .net中 过滤 指定 字符串
    js中replace的用法
    restart
    外部函数
    JQuery实现Ajax 根据商品名称自动显示价格
    ListView中命令行按钮应用;
    GridView中获取行数和列数
    全局应用程序类Global
    如何获取gridview中模板列中控件的值?
  • 原文地址:https://www.cnblogs.com/airry66/p/3966620.html
Copyright © 2011-2022 走看看