Code example for LinearLayout.LayoutParams

0
		getSupportActionBar().hide(); 
 
		final LinearLayout blackness = new LinearLayout(this);
		blackness.setLayoutParams(new LayoutParams(
				android.view.ViewGroup.LayoutParams.MATCH_PARENT,
				android.view.ViewGroup.LayoutParams.MATCH_PARENT));
 
		if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
			blackness.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
		} else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB) {
			blackness.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
		} 
 
		blackness.setBackgroundColor(Color.BLACK);
		Toast.makeText(this,
				"Your screen is in dim mode. To exit dim mode, touch or press any key.", 
				Toast.LENGTH_LONG).show();
		setContentView(blackness);
		try { 
			getSupportActionBar().setDisplayShowHomeEnabled(false); 
		} catch (NullPointerException npe) {