Nebraska Nebraska - 10 months ago 41
Android Question

Errors for no reason

I tried to run the code to test if the program works, but it doesn't seem to do anything. I am getting an error that the

can't be resolved (line 54) and a syntax error when I can't find one (line 100). Can you help debug it?

Here are the errors:

Description Resource Path Location Type
fullscreen_content_controls cannot be resolved or is not a field /MagicSquaresGame/src/com/mtprogramming/magicsquaresgame line 54 Java Problem

Description Resource Path Location Type
Syntax error, insert "}" to complete MethodBody /MagicSquaresGame/src/com/mtprogramming/magicsquaresgame line 100 Java Problem


* An example full-screen activity that shows and hides the system UI (i.e.
* status bar and navigation/system bar) with user interaction.
* @see SystemUiHider
public class Opening extends Activity {
* Whether or not the system UI should be auto-hidden after
* {@link #AUTO_HIDE_DELAY_MILLIS} milliseconds.
private static final boolean AUTO_HIDE = false;

* If {@link #AUTO_HIDE} is set, the number of milliseconds to wait after
* user interaction before hiding the system UI.
private static final int AUTO_HIDE_DELAY_MILLIS = 3000;

* If set, will toggle the system UI visibility upon interaction. Otherwise,
* will show the system UI visibility upon interaction.
private static final boolean TOGGLE_ON_CLICK = true;

* The flags to pass to {@link SystemUiHider#getInstance}.
private static final int HIDER_FLAGS = SystemUiHider.FLAG_HIDE_NAVIGATION;

* The instance of the {@link SystemUiHider} for this activity.
private SystemUiHider mSystemUiHider;

protected void onCreate(Bundle savedInstanceState) {


final View controlsView = findViewById(;
final View contentView = findViewById(;

// Set up an instance of SystemUiHider to control the system UI for
// this activity.
mSystemUiHider = SystemUiHider.getInstance(this, contentView,
.setOnVisibilityChangeListener(new SystemUiHider.OnVisibilityChangeListener() {
// Cached values.
int mControlsHeight;
int mShortAnimTime;

public void onVisibilityChange(boolean visible) {
// If the ViewPropertyAnimator API is available
// (Honeycomb MR2 and later), use it to animate the
// in-layout UI controls at the bottom of the
// screen.
if (mControlsHeight == 0) {
mControlsHeight = controlsView.getHeight();
if (mShortAnimTime == 0) {
mShortAnimTime = getResources().getInteger(
.translationY(visible ? 0 : mControlsHeight)
} else {
// If the ViewPropertyAnimator APIs aren't
// available, simply show or hide the in-layout UI
// controls.
controlsView.setVisibility(visible ? View.VISIBLE
: View.GONE);

if (visible && AUTO_HIDE) {
// Schedule a hide().

// Set up the user interaction to manually show or hide the system UI.

// Upon interacting with UI controls, delay any scheduled hide()
// operations to prevent the jarring behavior of controls going away
// while interacting with the UI.

protected void onPostCreate(Bundle savedInstanceState) {

// Trigger the initial hide() shortly after the activity has been
// created, to briefly hint to the user that UI controls
// are available.

* Touch listener to use for in-layout UI controls to delay hiding the
* system UI. This is to prevent the jarring behavior of controls going away
* while interacting with activity UI.
View.OnTouchListener mDelayHideTouchListener = new View.OnTouchListener() {
public boolean onTouch(View view, MotionEvent motionEvent) {
if (AUTO_HIDE) {
return false;

Handler mHideHandler = new Handler();
Runnable mHideRunnable = new Runnable() {
public void run() {

* Schedules a call to hide() in [delay] milliseconds, canceling any
* previously scheduled calls.
private void delayedHide(int delayMillis) {
mHideHandler.postDelayed(mHideRunnable, delayMillis);

Answer Source

Have you made sure that "fullscreen_content_controls" exists in your xml layout?

Your controlsView should have an id attribute