title: How can I make this Variable by UserInput work? android
body: <pre><code>public void onCreate(Bundle savedInstanceState)
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      mButton = (Button)findViewById(R.id.okay);
      mEdit  = (EditText)findViewById(R.id.name);
      final TextView questionOne =(TextView)findViewById(R.id.questionOne);
      final String name = mEdit.getText().toString(); //
  
      mButton.setOnClickListener(
              new View.OnClickListener()
              {
                  public void onClick(View view)
                  {
                      Log.v("EditText", mEdit.getText().toString());
                  }
              });
  
      mButton.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
  
              questionOne.setText("Tell me your lucky number, " + name + "!");
  
          }         });
  }
  </code></pre>
  
  <p>}</p>
  
  <p>So, my goal is to let the user write his name and then print it out with the setText method. In order to do this I declared the variable "name". But when I run the app and enter my name, it just prints out "Tell me your lucky number, !". So the variable name is missing completely. Can someone tell me what I did wrong with the variable, please?
  Thank you in advance!</p>