Splash screen in Android Application from stackoverflow

Use class SplashScreen as under

 

 

 

public class Splashscreen extends Activity {

private static final int SPLASH_DISPLAY_TIME = 3000; /* 3 seconds */

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.splash);

    new Handler().postDelayed(new Runnable() {

        public void run() {

            Intent mainIntent = new Intent(Splashscreen.this,
                    MainActivity.class);
            Splashscreen.this.startActivity(mainIntent);

            Splashscreen.this.finish();
            overridePendingTransition(R.anim.mainfadein,
                    R.anim.splashfadeout);
        }
    }, SPLASH_DISPLAY_TIME);
}

 

**Add mainfadein.xml & splashfadeout.xml in res->anim folder

mainfadein.xml**

<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
        android:interpolator="@android:anim/accelerate_interpolator"
        android:fromAlpha="0.0"
        android:toAlpha="1.0"
        android:duration="1000">
</alpha>

 

splashfadeout.xml

<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
        android:interpolator="@android:anim/decelerate_interpolator"
        android:zAdjustment="top"
        android:fromAlpha="1.0"
        android:toAlpha="0.0"
        android:duration="1000" >
</alpha>

 and add splash.xml just Add an ImageView and set its background as screen & add image of urchoice in layout

And make Splashscreen class as Launcher and make all other class as HOME in manifest file

 

 

from  http://stackoverflow.com/questions/8642730/splash-screen-in-android-application

Android 12中的splashscreen(启动画面)是一种应用程序启动时显示的短暂界面,用于提供应用程序的品牌标识和加载过程的视觉反馈。与以往的版本不同,Android 12引入了一些新的特性和改进来提升splashscreen的用户体验。 首先,Android 12的splashscreen支持更多的自定义选项。开发者可以选择使用单一的图片、动画或者视频作为splashscreen的背景,以展示应用程序的标志性元素或者品牌内容。这增强了应用程序的品牌识别度,并为用户提供了更具吸引力的界面。 其次,Android 12还支持在splashscreen上显示应用程序的加载进度。开发者可以通过进度指示器或动画来告知用户应用程序的加载进度,让用户对应用程序的启动过程有更清晰的认知。这种视觉反馈可以提高用户对应用程序的满意度,并为用户提供更好的等待体验。 此外,Android 12还增加了一个预热阶段(pre-warming)来提升splashscreen的加载速度。当用户点击应用程序图标时,系统会在显示splashscreen之前暂时加载应用程序的一部分数据和资源,以缩短splashscreen的显示时间和启动过程的等待时间。这使得用户可以更快地进入应用程序,提高了用户体验的流畅度。 综上所述,Android 12的splashscreen通过自定义选项、加载进度显示和预热阶段等特性和改进,提供了更具吸引力、更好的等待体验和更高的启动速度。这使得应用程序能够更好地展示自己的品牌标识,同时提升用户对应用程序的满意度和流畅度。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值