Android 简单闪屏实现
2010-05-10 19:46:00 来源:WEB开发网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 >
更多精彩
赞助商链接