I am wondering how to take an EditText area that the user can enter a number in, then make it an integer so it can be used in the program for adding, subtracting, dividing, etc. Basicaly I need the test the enter to be able to be used in a calculator which will be within the code and then it needs to be put into a TextView or string so the final answer can be seen by the user.
More info: I have three EditText areas and the user has to fill in all three then press "equals" and it will tell them the answer, all the math and such needs to be in the code so the user just enters information and doesn't actually calculate anything. Thanks for the help, please ask me if you need any more info.
The best way to do this and the code would help me a lot.
I have added the code that was suggested but I still get an error on parseInt and I still need to add a button to calculate the numbers entered in the EditText areas. How would I do this? Sorry I am fairly to Java and Android development.
package com.example.one;
import com.example.one.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class monthlyp extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.monthlyp);
EditText editone = (EditText) findViewById(R.id.editone);
EditText editoneValue = (EditText) editone.getText();
int editoneNum = Integer.parseInt(editoneValue);
}
;
}