Transfer int & double values throughout an activity
<p>Hi i am having problems transferring variable values throughout a single activity to do calculations based on if else statements and the values from the variables.</p>

<pre><code>private EditText edittext1;
private TextView option1, option2, option3, option4, option5,
                 option6, option7, option8, option9, option10,
                 output1, output2, output3, output4, output5,
                 output6, output7, output8, output9, output10,
                 textview16;
private int unitGroup, calculate;
String meter, squareMeter, centimeter;

double doubleInput, out1;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.converter);     

    ActionBar bar = getActionBar();
    bar.setDisplayHomeAsUpEnabled(true);

    Spinner spinner = (Spinner) findViewById(R.id.converter);
    ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(
            this, R.array.convert_array, android.R.layout.simple_spinner_item);
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    spinner.setAdapter(adapter);

    final Spinner spinner1 = (Spinner) findViewById(R.id.spinner1);
    final ArrayAdapter&lt;CharSequence&gt; length = ArrayAdapter.createFromResource(
            this, R.array.length_array, android.R.layout.simple_spinner_item);
    length.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    final ArrayAdapter&lt;CharSequence&gt; area = ArrayAdapter.createFromResource(
            this, R.array.area_array, android.R.layout.simple_spinner_item);
    area.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

    edittext1 = (EditText)findViewById(R.id.editText1);
    textview16 = (TextView)findViewById(R.id.TextView16);

    // Get unit option textview's
    option1 = (TextView)findViewById(R.id.option1);
    option2 = (TextView)findViewById(R.id.option2);
    option3 = (TextView)findViewById(R.id.option3);
    option4 = (TextView)findViewById(R.id.option4);
    option5 = (TextView)findViewById(R.id.option5);
    option6 = (TextView)findViewById(R.id.option6);
    option7 = (TextView)findViewById(R.id.option7);
    option8 = (TextView)findViewById(R.id.option8);
    option9 = (TextView)findViewById(R.id.option9);
    option10 = (TextView)findViewById(R.id.option10);

    // Get unit output textview's       
    output1 = (TextView)findViewById(R.id.output1);
    output2 = (TextView)findViewById(R.id.output2);
    output3 = (TextView)findViewById(R.id.output3);
    output4 = (TextView)findViewById(R.id.output4);
    output5 = (TextView)findViewById(R.id.output5);
    output6 = (TextView)findViewById(R.id.output6);
    output7 = (TextView)findViewById(R.id.output7);
    output8 = (TextView)findViewById(R.id.output8);
    output9 = (TextView)findViewById(R.id.output9);
    output10 = (TextView)findViewById(R.id.output10);



    spinner.setOnItemSelectedListener(new OnItemSelectedListener() {
        public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int pos, long id) {
            if(pos==0) {            
                spinner1.setAdapter(length);
                option1.setText("Meter");
                option2.setText("Centimeter");
                option3.setText("Millimeter");
                option4.setText("Kilometer");
                option5.setText("Inch");
                option6.setText("Foot");
                option7.setText("Yard");
                option8.setText("Mile");
                option9.setText("Astronomical Unit (AU)");
                option10.setText("Lightyear");
                unitGroup = 1;
            }
            if(pos==1) {            
                spinner1.setAdapter(area);
                option1.setText("Square Meter");
                option2.setText("Square Centimeter");
                option3.setText("Square Millimeter");
                option4.setText("Square Kilometer");
                option5.setText("Square Inch");
                option6.setText("Square Foot");
                option7.setText("Square Yard");
                option8.setText("Square Mile");
                option9.setText("Acre");
                option10.setText("Hectare");
                unitGroup = 2;
            }               
        } 

        public void onNothingSelected(AdapterView&lt;?&gt; parent) {
          // Do nothing.
        }
    });

    spinner1.setOnItemSelectedListener(new OnItemSelectedListener() {
        public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int pos, long id) {
            switch(pos) {
            case 0:
                if (unitGroup == 1) {
                    calculate = 0;
                }
                if (unitGroup == 2) {
                    calculate = 0;
                }
                return;
            case 1:
                if (unitGroup == 1) {
                    calculate = 1;
                }
                if (unitGroup == 2) {
                    calculate = 1;
                }
                return;
            default:
            }
        }           

        public void onNothingSelected(AdapterView&lt;?&gt; parent) {
          // Do nothing.
        }
    });

    String stringInput = (edittext1.getText().toString());
    if(stringInput.isEmpty()) {
        doubleInput = 0.0;
    }
    else {
        doubleInput = Double.parseDouble(edittext1.getText().toString());
    }

    textview16.setText("" + unitGroup);

    if (calculate == 0) {
        out1 = doubleInput * 1;
    }
    output1.setText("" + out1);

    if (calculate == 1) {
        out1 = doubleInput * 100;
    }
    output2.setText("" + out1);
}
</code></pre>

<p>No matter what I try everything just displays as 0 or 0.0. Is it something to do with the variables information not being transferred?</p>
