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已经初始 ...
随机推荐
- [笔记] 使用v2r访问外网
介绍 首先,你需要有一台能上外网的服务器,如AWS,GCP等. 其次,请自行复制全文,然后将FXXK替换为v2r的全称(5个小写字符). 服务器上Docker镜像配置流程 拉取镜像 $ sudo do ...
- xaml中显示 “大括号左边” 文本
Content="{}{" 最合适的还是上面的写法 转义符{不好使的 要么 空格{ 要么 全角{ 要么binding
- idea Ctrl+Alt+T 快捷键失效
idea快捷键 CTRL+ALT+T 把选中的代码放在 TRY{} IF{} ELSE{} 里 这个快捷键失效了,显然是热键冲突,查看了喜欢占热键的输入法.词典.微信.qq.都没找到占用,最后发现 ...
- Linux 如何上传/下载文件
注: 如果在操作中,提示没有权限请使用" su - "命令来切换当前账号至" root " 账号 一 . 使用 rz / sz 命令 1 . 登陆 Li ...
- ios 后台进程弹窗
// http://iphonedevwiki.net/index.php/CFUserNotification // https://kunnan.github.io/2018/05/14/com. ...
- JavaEE_Test2_Servlet
package servlet; import javax.servlet.http.HttpSession; import java.io.IOException; import java.io.P ...
- VMware重装:网络适配器驱动安装失败解决办法
参考链接:https://blog.csdn.net/theConqueror/article/details/80449125
- 最大熵马尔科夫模型(MEMM)及其标签偏置问题
定义: MEMM是这样的一个概率模型,即在给定的观察状态和前一状态的条件下,出现当前状态的概率. Ø S表示状态的有限集合 Ø O表示观察序列集合 Ø Pr(s|s’,o):观察和状态转移概 ...
- sass安装:webpack sass编译失败,node-sass安装失败的终极解决方
文章来源:sass安装:webpack sass编译失败,node-sass安装失败的终极解决方 sass难言之隐-sass安装的坑 之前花了很多时间折腾node-sass,发现sass老是安装不上 ...
- Durable NAND flash memory management
词条积累 1.NAND flash memory http://www.searchstorage.com.cn/whatis/word_6052.htm http://baike.baidu.com ...