title: How to display a calculation from user input in android studio
body: <p>I am using android studio &amp; want to create an app that allows me to calculate metal object weights.  I know the formula but not how to apply it with user input.</p>
  
  <p>I am only thinking on tubes at present so the user adds the outside diameter, inside diameter &amp; length.</p>
  
  <p>I would like to know where to put the code &amp; how to make a calculation based on this user input by them clicking on a button.</p>
  
  <p>My current code is as follows</p>
  
  <pre><code>    package com.example.nealu.myapplication;
  
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.widget.EditText;
  
  
  public class MainActivity extends AppCompatActivity {
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
      }
  
  public void onAddClick(View a) {
  if(a.getId() == R.id.editText)
  }
      @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);
      }
  }
  </code></pre>
  
  <p>Please let me know if Im not making sense!!</p>
  
  <p>All help greatly appreciated cant find quote what I need searching around</p>
  
  <p>Thanks</p>