So I am having issues compiling my code in Android Studio. In my onCreate() method, I have multiple references to my contentView called activity_game.xml. However, I have a single variable that is not being found and I am unsure why. I have tried to clean project then rebuild, No luck. I have tried to set the text directly below thinking maybe the issue is how I am filling Time, this also did not help. (I reference in a separate class contained within my entire game class and use a global variable.) Here is the beginning code of my onCreate() method, Any suggestions?
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_game); gamePrefs = getSharedPreferences(GAME_PREFS, 0); scoreText = (TextView) findViewById(R.id.score); timeText = (TextView) findViewById(R.id.time); timeText.setText(getString(R.string.timeText)); start_count = new StartCount(3000,1000); background = (RelativeLayout) findViewById(R.id.relativeLayout); position0 = (Button)findViewById(R.id.red); position1 = (Button)findViewById(R.id.yellow); position2 = (Button)findViewById(R.id.blue); position3 = (Button)findViewById(R.id.green);
No comments:
Post a Comment