WEB开发网
开发学院手机开发Android 开发 Android 简单闪屏实现 阅读

Android 简单闪屏实现

 2010-05-10 19:46:00 来源:WEB开发网   
核心提示:m_bPaused=true;}@Overrideprotected void onResume() {super.onResume();m_bPaused=false;}@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {super.onKe

m_bPaused=true;

}

@Override

protected void onResume() {

super.onResume();

m_bPaused=false;

}

@Override

public boolean onKeyDown(int keyCode, KeyEvent event) {

super.onKeyDown(keyCode, event);

switch(keyCode){

case KeyEvent.KEYCODE_MENU:

m_bSplashActive=false;

break;

case KeyEvent.KEYCODE_BACK:

/*两种退出方法*/

/* System.exit(0);*/

/* android.os.Process.killProcess(android.os.Process.myPid());*/

android.os.Process.killProcess(android.os.Process.myPid());

break;

default:

break;

}

return true;

}

}

view source

print?

1 < p > < /p >

view source

print?

1

AndroidManifest.xml 这里面配置很重要

代码

< ?xml version="1.0" encoding="utf-8"? >

< manifest xmlns:android="http://schemas.android.com/apk/res/android"

package="com.demo"

android:versionCode="1"

android:versionName="1.0" >

< application android:icon="@drawable/icon" android:label="@string/app_name" >

< activity android:name="test" android:label="@string/app_name" >

< intent-filter >

< action android:name="android.intent.action.MAIN" / >

< category android:name="android.intent.category.LAUNCHER" / >

< /intent-filter >

< /activity >

< activity android:name=".MainMenu" android:label="@string/app_name" >

< intent-filter >

< action android:name="com.google.app.splashy.CLEARSPLASH" / >

< category android:name="android.intent.category.DEFAULT" / >

< /intent-filter >

< /activity >

< /application >

< /manifest >

上一页  1 2 

Tags:Android 简单 实现

编辑录入:coldstar [复制链接] [打 印]
赞助商链接