title: New coder, doing third project, can not get app to run
body: <p>I am a new coder, creating a higher or lower guessing game app in Android Studio using the Java language. My goal for this project is for the user to be able to input a number between 1 and 100, and for the app to be able to pick a random number each time the user plays the game, and for the app to be able to tell the user if the number they picked is the correct answer, or higher or lower. I am using Android studio using Java. I have all the code there, I just keep getting a couple error answers. For instance, on my &quot;if (guess &lt; theNumber) statements, the word &quot;guess is in red&quot; and says it cannot resolve symbol guess. And the statement &quot;private Button btnGuess&quot; the btnGuess is in grey and it says that it's never used, but I have the id in the design tab of Android Studio and it's id is labeled btnGuess and I thought that I wired it into the code, when I try to run the app through the emulator it just does not even run. I've tried googling around for the answer, but since I am new to coding I'm not sure that I'm asking the correct questions, I've included the code for reference, thank you very much in advance.</p>
  <pre><code>ckage com.example.billyhodgesguessinggame;
  
  import android.os.Bundle;
  import android.support.design.widget.Snackbar;
  import android.support.v7.app.AppCompatActivity;
  import android.view.View;
  
  import androidx.navigation.NavController;
  import androidx.navigation.Navigation;
  import androidx.navigation.ui.AppBarConfiguration;
  import androidx.navigation.ui.NavigationUI;
  
  import com.example.billyhodgesguessinggame.databinding.ActivityMainBinding;
  
  import android.view.Menu;
  import android.view.MenuItem;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.TextView;
  
  public class MainActivity extends AppCompatActivity {
     private EditText txtGuess;
     private Button btnGuess;
     private TextView lblOutput;
     private int theNumber;
     public void checkGuess() {
         String guessText = txtGuess.getText().toString();
         String message = &quot;&quot;;
         try {
             int Guess = Integer.parseInt(guessText);
             if (guess &lt; theNumber)
                 message = guess + &quot;is too low. Try again.&quot;;
             else if (guess &gt; theNumber)
                 message = guess + &quot;is too high. Try again.&quot;;
             else {
                 message = guess +
                         &quot;is correct. You win! Let's play again!&quot;;
                 newGame();
             }
         } catch (Exception e) {
             message = &quot;Enter a whole number between 1 and 100.&quot;;
         } finally {
             lblOutput.setText(message);
             txtGuess.requestFocus();
             txtGuess.selectAll();
         }
  
     }
  
  
     private AppBarConfiguration appBarConfiguration;
  
     public void newGame() {
         theNumber = (int)(Math.random() * 100 + 1);
     }
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_main);
  
         txtGuess = findViewById(R.id.txtGuess);
         Button btnGuess = findViewById(R.id.btnGuess);
         lblOutput = findViewById (R.id.lblOutput);
         newGame();
         btnGuess.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick (View v) {
                 checkGuess();
             }
         });
  
  
         com.example.billyhodgesguessinggame.databinding.ActivityMainBinding binding = ActivityMainBinding.inflate(getLayoutInflater());
         setContentView(binding.getRoot());
  
         setSupportActionBar(binding.toolbar);
  
         NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
         appBarConfiguration = new AppBarConfiguration.Builder(navController.getGraph()).build();
         NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
  
         binding.fab.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View view) {
                 Snackbar.make(view, &quot;Replace with your own action&quot;, Snackbar.LENGTH_LONG)
                         .setAction(&quot;Action&quot;, null).show();
             }
         });
     }
  
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
         // Inflate the menu; this adds items to the action bar if it is present.
         getMenuInflater().inflate(R.menu.menu_main, menu);
         return true;
     }
  
     @Override
     public boolean onOptionsItemSelected(MenuItem item) {
         // Handle action bar item clicks here. The action bar will
         // automatically handle clicks on the Home/Up button, so long
         // as you specify a parent activity in AndroidManifest.xml.
         int id = item.getItemId();
  
         //noinspection SimplifiableIfStatement
         if (id == R.id.action_settings) {
             return true;
         }
  
         return super.onOptionsItemSelected(item);
     }
  
     @Override
     public boolean onSupportNavigateUp() {
         NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
         return NavigationUI.navigateUp(navController, appBarConfiguration)
                 || super.onSupportNavigateUp();
     }
  }
  </code></pre>