title: Text to url parameter android app
body: <p>I trying to do an app to query orders of my company. It's the layout:
  <a href="https://ibb.co/mh8EOH" rel="nofollow noreferrer">https://ibb.co/mh8EOH</a></p>
  
  <p>It's my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>#public class Orders extends AppCompatActivity {
      EditText query; // declare here
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_Orders);
  
          Button btn = (Button)findViewById(R.id.button);
  
          EditText et = (EditText)findViewById(R.id.editTextId1);
          String query = et.getText().toString();
  
          btn.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Intent i = new Intent(getApplicationContext(), Webview.class);
                  i.putExtra("url", "https://mysite/query?order="+query);
                  startActivity(i);
              }
          });
  
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>So... in android studio is showed "Variale 'query' is accessed from within inner class needs to be declared final"</p>
  
  <p>What's wrong? I wanna use input text to pass parameter to url.</p>