开源项目--来电管理精灵(一) 线程实现SplashScreen
来源:互联网 发布:no python inter 编辑:程序博客网 时间:2024/06/10 04:24
现在我就给大家看下我是怎么设计SplashScreen这个页面。
代码如下:
SplashScreen.java
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;
import android.view.WindowManager;
public class SplashScreen extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//实现了页面的全屏设置
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.splashscreen);
//使用了线程来实现SplashScreen效果代码在这里我设置了红色字体5000 即为5秒钟
new Handler().postDelayed(new Runnable(){
@Override
public void run() {
// TODO Auto-generated method stub
Intent intent=new Intent(SplashScreen.this,MainScreen.class);
SplashScreen.this.startActivity(intent);
SplashScreen.this.finish();
}
},5000);
}
}
现在看下我们这个页面的XML文件是怎么实现的吧
splashscreen.xml (说明:XML文件名必须为小写字母)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/splashbg" android:gravity="center">
<ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/splashlogo"></ImageView>
</RelativeLayout>
注意:在AndroidManifest.xml文件中必须加这句否则会出错
<activity android:name="com.tosum.app.SplashScreen" android:screenOrientation="portrait"></activity>
- 开源项目--来电管理精灵(一) 线程实现SplashScreen
- (转)来电精灵Pro
- Cocoa下实现SplashScreen
- SplashScreen实现加载数据
- Mymusic SplashScreen界面实现
- React Native Splashscreen实现
- 来电拦截、来电挂断,通过反射实现一键挂断
- Android之来电秀实现(一)
- SplashScreen
- Android启动页SplashScreen实现
- 深入Java线程管理(一):线程的实现方式
- 来电精灵 pro pocket pc 官方
- Android来电管理
- Android黑名单来电管理
- Qml 实现一个简单的SplashScreen
- Javaweb实现旅游管理系统(商城项目)(一)
- 一.项目管理基础知识
- 网站项目管理(一)
- 工科人的焦虑
- HP大中华区总裁孙振耀退休感言
- [Amazon AWS 云计算服务] - 从无到有 创建完整Amazon EC2实例
- 关于栈对齐(stack alignment)
- 如果有一天我不再烦你-bread
- 开源项目--来电管理精灵(一) 线程实现SplashScreen
- 11月21日 php数组
- jQuery inptip
- 公司
- 我很喜欢现在的生活
- CHOICE
- 考试院项目反思
- Windows PowerShell 2.0 语言之循环语句
- TopCoder SquareDigits