android app 闪屏
main activity
package com.splash.screen; import android.app.Activity;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.widget.ImageView; import com.newbravo.sg.Game;
import com.newbravo.sg.R; /**
* Created by lyhd on 2016/8/2.
*/
public class LogoSplashActivity extends Activity { private LogoSplashActivity mySplashActivity;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d("LogoSplashActivity","onCreate");
mySplashActivity = this;
// 取消标题
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
// 取消状态栏
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.logo_splash); Log.d("cgz_android: ",this.getExternalFilesDir(null).toString()); //第一种闪屏方式
// 闪屏的核心代码
// new Handler().postDelayed(new Runnable() {
// @Override
// public void run() {
// Intent intent = new Intent(LogoSplashActivity.this,
// Game.class); // 从启动动画ui跳转到主ui
// startActivity(intent);
// mySplashActivity.overridePendingTransition(R.anim.in_screen,
// R.anim.out_screen);
// LogoSplashActivity.this.finish(); // 结束启动动画界面
//
// }
// }, 3000); // 启动动画持续3秒钟 //第二种方式 ImageView logoImage = (ImageView) this.findViewById(R.id.logo_splash);
AlphaAnimation alphaAnimation = new AlphaAnimation(0.1f, 1.0f);
alphaAnimation.setDuration(3000);
logoImage.startAnimation(alphaAnimation);
alphaAnimation.setAnimationListener(new Animation.AnimationListener() { @Override
public void onAnimationStart(Animation animation) { } @Override
public void onAnimationRepeat(Animation animation) { } @Override
public void onAnimationEnd(Animation animation) {
Intent intent = new Intent();
intent.setClass(LogoSplashActivity.this, Game.class);
intent.setAction(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
startActivity(intent);
//startActivity(new Intent("com.google.app.splashy.CLEARSPLASH"));
finish();
}
});
} @Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
} @Override
protected void onPause() {
super.onPause(); } @Override
protected void onResume() {
super.onResume(); }
}
所用的1个layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"> <ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:id="@+id/logo_splash"
android:src="@drawable/logo_splash"/>
</LinearLayout>
android app 闪屏的更多相关文章
- android 的闪屏效果
android的闪屏效果,就是我们刚开始启动应用的时候弹出的界面或者动画,过2秒之后自动的跳转到主界面. 其实,实现这个效果很简单,使用Handler对象的postDelayed方法就可以实现.在这个 ...
- iphone 6plus 下app里的状态栏和界面会被放大的问题//以及设置APP闪屏页/APP图标流程
//设置APP闪屏页/APP图标流程如下 2.6Plus界面显示变大以及APP图标变大是由于上面图片的AppIcon以及LaunchImage造成的,主要是由于找不到对应的3x图片,或者改3x图片尺寸 ...
- Android 实现闪屏页和右上角的倒计时跳转
效果图: 闪屏页用到了handler和CountDownTimer类,还需配置一下Activity的主题,这里是:android:theme="@android:style/Theme.No ...
- 关于android应用闪屏的几种情况
1.主菜单进入某应用闪屏: 常见是一个空的activity作为launcher属性,实际上它什么事业没干,真正干事情的是从它通过intent启动的activity. 例子: public class ...
- Android App 启动页(Splash)黑/白闪屏现象产生原因与解决办法(转)
转载: Android App 启动页(Splash)黑/白闪屏现象产生原因与解决办法 首先感谢博主分享,本文作为学习记录 惊鸿一瞥 微信的启动页,相信大家都不陌生. 不知道大家有没有发现一个现象 ...
- 033 Android App启动的闪屏效果+新手向导(多个图片滑动效果)+ViewPager使用
1.目标效果 App启动时,出现闪屏效果(利用动画实现). App新手使用时,会出现新手向导效果. 2.XML页面布局 (1)闪屏页面 <?xml version="1.0" ...
- Android app启动出现白屏闪屏
出现白屏闪屏原因: 进入到AppStartActivity,但是未加载到布局文件,就先显示了窗口的背景,白屏就是显示的windows的背景,即所设置的theme. onCreate()中的setCon ...
- android开发之splash闪屏页判断是否第一次进入app代码
package com.david.david.zhankudemo.activity; import android.app.Activity; import android.content.Con ...
- imx6 android 进入文件系统闪屏
imx6进入文件系统的时候都会闪屏,应该是framebuffer未初始化,就已经打开了背光.目前解决办法,在kenel阶段关闭背光,显示android的开机动画之后(此时framebuffer已经初始 ...
随机推荐
- 阶段3 3.SpringMVC·_05.文件上传_3 文件上传之Springmvc方式上传原理分析
需要配置文件解析器这个对象 id配置时候必须叫做mutipartResolver 最终
- 阶段3 3.SpringMVC·_03.SpringMVC常用注解_2 RequestBody注解
拿整个请求体的数据
- ACO 蚁群算法(算法流程,TSP例子解析)
算法 计算机 超级计算 高性能 科学探索 1. 算法背景——蚁群的自组织行为特征 高度结构化的组织——虽然蚂蚁的个体行为极其简单,但由个体组成的蚁群却构成高度结构化的社会组织,蚂蚁社会的成员有分工,有 ...
- [笔记] Ubuntu机器添加新硬盘安装流程
SSD虽然快,但是容量不够用,买了块希捷4TB的机械硬盘,准备给台机扩容. 安装环境 OS: Ubuntu 18.04 安装新硬盘 问了客服,原来这款机箱已经带了硬盘滑槽,不需要固定螺钉了. 买了SA ...
- 配置 Nginx 错误页面优雅显示
[root@localhost ~]# cat /usr/local/nginx/conf/nginx.conf ...... http { location / { root html/www; i ...
- C#字符串内插-$
1.字符串内插 $特殊字符将字符串文本标识未内插字符串,可能包含内插表达式的字符串文本. 将内插字符串解析为结果字符串,带有内插表达式的项会替换为表达式结果的字符串表示形式. 在C#6级更高版本语言中 ...
- 【HANA系列】SAP HANA SQL条件判断是NULL的写法
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[HANA系列]SAP HANA SQL条件判断 ...
- 大数据技术之kettle
大数据技术之kettle 第1章 kettle概述 1.1 什么是kettle kettle是一款开源的ETL工具,纯java编写,可以在Windows.Linux.Uni ...
- Adobe Acrobat XI 中文版激活方法
Adobe Acrobat XI不仅只是出色的PDF编辑.转换软件.此次更新深度整合了Microsoft Office套件,实现了PDF与Word.Excel以及PowerPoint等文档间的无缝相互 ...
- Django book 2.0 的中文翻译
传送门大法好: http://djangobook.py3k.cn/2.0/