package com.lgq.rssreader;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
/**
* ����
* @author walkingp
* @date:2011-12
*
*/
public class SplashActivity extends Activity{
public void onCreate(Bundle savedInstanceState) {
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
// The UI options currently enabled are represented by a bitfield.
// getSystemUiVisibility() gives us that bitfield. _STICKY
int uiOptions = getWindow().getDecorView().getSystemUiVisibility();
int newUiOptions = uiOptions;
boolean isImmersiveModeEnabled =
((uiOptions | View.SYSTEM_UI_FLAG_IMMERSIVE) == uiOptions);
if (isImmersiveModeEnabled) {
Log.i("RssReader", "Turning immersive mode mode off. ");
} else {
Log.i("RssReader", "Turning immersive mode mode on.");
}
// Immersive mode: Backward compatible to KitKat (API 19).
// Note that this flag doesn't do anything by itself, it only augments the behavior
// of HIDE_NAVIGATION and FLAG_FULLSCREEN. For the purposes of this sample
// all three flags are being toggled together.
// This sample uses the "sticky" form of immersive mode, which will let the user swipe
// the bars back in again, but will automatically make them disappear a few seconds later.
newUiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
newUiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;
newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
getWindow().getDecorView().setSystemUiVisibility(newUiOptions);
new Handler().postDelayed(new Runnable(){
public void run() {
RedirectMainActivity();
}
},3000);
}
/**
* ��ת
*/
private void RedirectMainActivity(){
Intent i = new Intent();
i.setClass(SplashActivity.this,MainActivity.class);
startActivity(i);
SplashActivity.this.finish();
}
}