I am using edittexts with a textview when edittext get numbers textview show result but when I used Integer edt crashes after 10 digits. then I used double but now it is showing .0 in textview and also E between result

I have already tried each and every possible answer from stackoverflow but not succeeded in my case.

here is my activity

```
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_catering);

    edt1 = (EditText) findViewById(R.id.starters);
    edt2 = (EditText) findViewById(R.id.breakfast);
    tv = (TextView) findViewById(R.id.textView2);

    edt1.addTextChangedListener(mTextWatcher);
    edt2.addTextChangedListener(mTextWatcher);

    sharedPreferences = getSharedPreferences("Expences", MODE_PRIVATE);

    tv.setText(sharedPreferences.getString("exp","hello"));

    edt1.setText(sharedPreferences.getString("edt1","5"));

    edt2.setText(sharedPreferences.getString("edt2","5"));
}

public TextWatcher mTextWatcher = new TextWatcher() {
    @Override
    public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
    }

    @Override
    public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        tv.setText(addNumbers());

        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putString("exp", addNumbers());
        edit.apply();
        tv.setText( addNumbers());
    }

    @Override
    public void afterTextChanged(Editable editable) {

    }
};

private String addNumbers() {
    double number1;
    double number2;

    if (edt1.getText().toString() != "" && edt1.getText().length() > 0) {
        number1 = Double.parseDouble(edt1.getText().toString());

        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putString("edt1", "5");
        edit.commit();
    } else {
        number1 = 0;
    }

    if (edt2.getText().toString() != "" && edt2.getText().length() > 0) {
        number2 = Double.parseDouble(edt2.getText().toString());
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putString("edt2", "5");
        edit.commit();
    } else {
        number2 = 0;
    }
    return Double.toString(number1 + number2);
}

```

I have already tried this but app crashes when I enter 9 digits in edit text

```
 private String addNumbers() {
    int number1;
    int number2;
    if (edt1.getText().toString() != "" && edt1.getText().length() > 0) {
        number1 = Integer.parseInt(edt1.getText().toString());

        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putString("edt1", "5");
        edit.commit();

    } else {
        number1 = 0;
    }
    if (edt2.getText().toString() != "" && edt2.getText().length() > 0) {
        number2 = Integer.parseInt(edt2.getText().toString());
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putString("edt2", "5");
        edit.commit();
    } else {
        number2 = 0;
    }

    return Integer.toString(number1 + number2);

```

[![enter image description here](https://i.stack.imgur.com/JjTty.png)](https://i.stack.imgur.com/JjTty.png)

[![enter image description here](https://i.stack.imgur.com/V8HI1.png)](https://i.stack.imgur.com/V8HI1.png)