美文网首页
Splash界面

Splash界面

作者: jsnow0613 | 来源:发表于2016-03-29 11:44 被阅读108次

大多数的Splash界面都是会等待一定时间,然后切换到下一个界面;其实,在这段时间里,可以对系统状况进行检测,比如网络是否通,电源是否充足;或者,预先加载相关数据;

源码示例

AndroidMenifest.xml

<activity android:icon="@drawable/app_icon"
          android:screenOrientation="portrait"
          android:name=".splashScreen"
          android:theme="@android:style/Theme.NoTitleBar">
          <intent-filter>
              <action android:name="android.intent.action.MAIN"/>
              <category android:name="android.intent.category.LAUNCHER"/>
          </intent-filter>
</activity>

splashScreen.java

public class splashScreen extends Activity {
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.splashscreen);

        new Handler().postDelayed(new Runnable() {
            public void run() {
                Intent intent = new Intent(splashScreen.this, MainActivity.class);
                startActivity(intent);
                finish();
            }
        }, 2000); 
    }
}

相关文章

  • Splash界面

    大多数的Splash界面都是会等待一定时间,然后切换到下一个界面;其实,在这段时间里,可以对系统状况进行检测,比如...

  • Splash启动界面秒开的正确打开模式

    谷歌建议 谷歌在material design中提倡使用Splash启动界面。那Splash启动界面如何呈现秒开的...

  • 手机卫士之Splash界面

    手机卫士之Splash界面 splash: 溅,洒定义一个SplashActivity作为一款软件的打开界面,它承...

  • 手机卫士涉及的知识点总结

    手机卫士涉及的知识点总结 Splash界面 splash: 溅,洒 展现产品的logo提升产品的知名度初始化操作(...

  • NewsApp01

    阅读原文 1. 项目包含技术点 2. 欢迎界面SplashActivity 布局文件activity_splash...

  • Splash界面的Rx实现

    换了家公司上班,忙着公司的项目,好一段时间没写博客了,今天就来分享Android中Splash界面Rx的一种实现方...

  • Splash界面的实现过程

    一.splash界面的作用 用来展现产品的Logo 应用程序初始化的操作 检查应用程序的版本 检查当前应用程序是否...

  • 打造启动页面

    启动页面 目前,很多 Android 应用都有一个启动界面 (Launch/Splash Screen),即应用在...

  • uni-app设置引导页源码

    是引导页(guide) 不是 启动界面 (splash)详细设置步骤见:uniapp设置引导页 https://w...

  • debain unable to bind to codec,导

    临时解决 在grub编辑界面将linux所在行 ro 后的quiet splash 或者nomodeset 全部删...

网友评论

      本文标题:Splash界面

      本文链接:https://www.haomeiwen.com/subject/oahdlttx.html