I'm write this code for set fullscreen to my activity:
protected 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.activity_main);
ImageView img=(ImageView)findViewById(R.id.imageView1);
img.setImageResource(R.drawable.tologo);
getWindow().getDecorView().setBackgroundColor(Color.WHITE);
}
but when i run the my app i get this error:
Caused by: android.util.AndroidRuntimeException: requestFeature() must be called before adding content
I'm write that code from this link:
TUTORIAL