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已经初始 ...
随机推荐
- Java split(".") 和 split("\\.")
Java split(".") 和 split("\\.") 问题描述 使用 . 分解 IP 的各个段,并打印,如:192.168.10.123,分解为 192 ...
- Oracle数据库提高sql查询效率总结
我们要做到不但会写SQL,还要做到写出性能优良的SQL语句. (1)选择最有效率的表名顺序(只在基于规则的优化器中有效): Oracle的解析器按照从右到左的顺序处理FROM子句中的表名,FROM子句 ...
- 有道自然语言翻译和文字识别OCR(图片文字识别)接口调用
官网 http://ai.youdao.com 文档地址 http://ai.youdao.com/docs/doc-ocr-api.s#p01 在Python中调用api. #/usr/bin/en ...
- CentOS6.5升级手动安装GCC4.8.2 转载
一.简易安装 操作环境 CentOS6.5 64bit,原版本4.4.7,不能支持C++11的特性~,希望升级到4.8.2 不能通过yum的方法升级,需要自己手动下载安装包并编译 1.1 获取安装包并 ...
- Go语言集成开发工具JetBrains GoLandMac2.3中文版
JetBrAIns GoLand for Mac是是专为Go开发人员构建的跨平台IDE,功能非常强大拥有强大的代码洞察力,帮助所有Go开发人员即时错误检测和修复建议,快速和安全的重构,一步撤销,智能 ...
- easyui datagrid checkbox复选框取消单击选中事件、初始全选全不选等问题解决
系统业务需要,导入的列表数据默认全部选中,且不可取消选中行.全部店铺优惠券发放过后导入的数据全部清空.如图所示: 一.初始化页面默认全部选中“selectAll”,全部不选中“unselectAll” ...
- 【VS开发】CTimeSpan类
CTimeSpan类. 日期和时间类简介 CTime类的对象表示的时间是基于格林威治标准时间(GMT)的.CTimeSpan类的对象表示的是时间间隔. CTi ...
- 复杂json格式转化为javabean
工具阿里巴巴的fastjson包 <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson --><dependenc ...
- typescript中新增的基本数据类型
javascript中有7种数据类型,分别是:boolean,number,string,null,undefined和object,以及在es6中新增的一种类型 symbol.而typescript ...
- 实现一台Linux电脑连接另一台Linux(SSH实现linux之间的免密码登陆)
怎么实现一台Linux电脑连接另一台Linux电脑? 首先查看是否安装ssh服务:systemctl status sshd.service 启动服务:systemctl start sshd.ser ...