zoukankan      html  css  js  c++  java
  • Android 启动后页面跳转

      1.LoadingActivity

      

    public class LoadingActivity extends Activity
      implements Handler.Callback
    {
      private Handler mHandler;
      private Timer mTimer;
      private View mView;
    
      public boolean handleMessage(Message paramMessage)
      {
        switch (paramMessage.what)
        {
        default:
             return false;
        case 0:
             startActivity(new Intent(this, MenuActivity.class));
             overridePendingTransition(R.anim.left_in, R.anim.left_out);
             finish();
        }
        return false;
      }
    /*schedule(TimerTask task, long delay)的注释:Schedules the specified task for execution after the specified delay。大意是在延时delay毫秒后执行task。并没有提到重复执行
     */
      public void onCreate(Bundle paramBundle)
      {
        super.onCreate(paramBundle);
        setContentView(R.layout.loading);
        this.mView = findViewById(R.id.rl_loading);
        this.mHandler = new Handler(this);
        this.mTimer = new Timer();
        this.mTimer.schedule(new TimerTask()
        {
          public void run()
          {
            LoadingActivity.this.mHandler.sendEmptyMessage(0);
          }
        }
        , 3000L);
      }
    
      public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
      {
        this.mTimer.cancel();
        return super.onKeyDown(paramInt, paramKeyEvent);
      }
    
      protected void onPause()
      {
        super.onPause();
      }
    
      protected void onResume()
      {
        super.onResume();
      }
    }

       2.left_in.xml

           

    <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:duration="500" android:fromXDelta="100.0%p" android:toXDelta="0.0" /> </set>

       3.left_out.xml

    <?xml version="1.0" encoding="utf-8"?>
    <set
      xmlns:android="http://schemas.android.com/apk/res/android">
        <translate android:duration="500" android:fromXDelta="0.0" android:toXDelta="-100.0%p" />
    </set>
  • 相关阅读:
    iOS使用Charles(青花瓷)抓包并篡改返回数据图文详解(转)
    iOS 9 添加白名单
    iOS 中字体的应用(转)
    iOS 后台操作的开发(转)
    iOS 知识点大总结(转)
    在Xcode中找中文字符串(正则表达式)
    block 使用时的注意点(转)
    xcode armv6 armv7 armv7s arm64 (转)
    使用Android studio过程中发现的几个解决R变红的办法
    折腾了一晚上的“equals”和“==”
  • 原文地址:https://www.cnblogs.com/konf/p/3948246.html
Copyright © 2011-2022 走看看