package chrisjluc.funsearch.base;

import android.app.ActionBar;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;

public class BaseActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
        super.onCreate(savedInstanceState);
    }

    @Override
    protected void onResume() {
        setFullscreen();
        super.onResume();
    }


    protected void setFullscreen() {
        View decorView = getWindow().getDecorView();
        int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                | View.SYSTEM_UI_FLAG_FULLSCREEN
                | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
        decorView.setSystemUiVisibility(uiOptions);
        ActionBar actionBar = getActionBar();
        if (actionBar != null)
            actionBar.hide();
    }
}

@@ -87,16 +87,98 @@
 tivity;%0A
+import android.content.pm.ActivityInfo;%0Aimport android.content.res.Configuration;%0A
 import a
@@ -195,16 +195,16 @@
 Bundle;%0A
-
 import a
@@ -370,24 +370,68 @@
 nceState) %7B%0A
+        super.onCreate(savedInstanceState);%0A
         getW
@@ -509,40 +509,282 @@
    s
-uper.onCreate(savedInstanceState
+etRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);%0A    %7D%0A%0A    @Override%0A    public void onConfigurationChanged(Configuration newConfig) %7B%0A        super.onConfigurationChanged(newConfig);%0A        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
 );%0A 
@@ -890,16 +890,15 @@
 ();%0A
+
     %7D%0A%0A
-%0A
     

Set portrait mode