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已经初始 ...
随机推荐
- Linux 查找特定程序 whereis
Linux 查找特定程序 whereis whereis 命令主要用于查找程序文件,并提供这个文件的二进制可执行文件.源代码文件和使用手册存放位置. 1.查找命令程序 例如,查找 touch 命令 [ ...
- 绝对好用Flash多文件大文件上传控件
本实例采用的是Uploadify上传插件,.NET程序,源程序是从网上找的,但是有Bug,已经修改好,并标有部分注释.绝对好用,支持单文件.多文件上传,支持大文件上传,已经过多方面测试,保证好用. 以 ...
- maven中GroupID 和ArtifactID
artifactId :unique base name of the primary artifact being generated by this project GroupID 是项目组织唯一 ...
- win10相机打不开,显示错误代码0xA00F4246(0x800706D9)
有时我们在不知道什么情况下电脑便会变成这个样子,当我们以为是驱动问题的时候,或许我们可以使用下面的办法解决这个问题 方法: 1.WIN键+R打开命令端,输入regedit运行 2.进入 计算机\HKE ...
- 配置传统vlan间路由
S1#SH RUN spanning-tree mode pvst ! interface FastEthernet0/1 switchport access vlan 10 switchport m ...
- C++ unsigned long 转化为 unsigned char*
C++ Code 123456789101112131415161718 unsigned long lFileLen = 1000; unsigned char *ucFileLenFlag; ...
- # C++中对PI的引用
#include <iostream> #include <cmath> using namespace std; int main(){ printf("%.10l ...
- 使用php过滤emoji表情
/** * 过滤字符串中表情 * @param $str string 昵称 * @return string */ public function filterEmoji($str) { $str ...
- 从入门到自闭之Python函数初识
函数初识 定义:def--关键字 将某个功能封装到一个空间中就是一个函数 功能: 减少重复代码 函数的调用 函数名+():调用函数和接收返回值 函数的返回值 return 值 == 返回值 ...
- python-day31(正式学习)
一.单机架构 应用领域: 植物大战僵尸 office 二.CS架构 应用领域: QQ 大型网络游戏 计算机发展初期用户去取数据,直接就去主机拿,从这里开始就分出了客户端和服务端. 客户端:用户安装的软 ...