I tried to create a Guess Number Game, which I set up a range of number and edit text for user to enter the number. I tried to input, for example "50" but when I tried to delete, I could only delete the "0". If I keep delete the number "5" the app crashed. Here are my MainActivity codes: 

```
import java.util.Random;

public class MainActivity extends AppCompatActivity {
  TextView textViewChoice, textViewStatus;
  EditText editTextNum ;

Button buttonSetting;
SharedPreferences preferences;

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

    textViewChoice = (TextView) findViewById(R.id.textViewChoice);
    textViewStatus =(TextView) findViewById(R.id.textviewStatus);
    editTextNum = (EditText) findViewById(R.id.edittextGuess);

    buttonSetting =(Button) findViewById(R.id.buttonSetting);
    preferences = getSharedPreferences("LIMITS",MODE_PRIVATE);

    buttonSetting.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent intent = new Intent(MainActivity.this, SecondaryActivity.class);
            startActivity(intent);
        }
    });
}

@Override
protected void onStart() {
    super.onStart();
    final int MinNumber = preferences.getInt("Seekbar Min", 0);
    final int MaxNumber = preferences.getInt("Seekbar Max", 0);
    textViewChoice.setText("" + MinNumber + "-" + MaxNumber);

    editTextNum.addTextChangedListener(new TextWatcher() {
        @Override
        public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {

        }

        @Override
        public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
            Random random = new Random();
            int RanNum = random.nextInt(MaxNumber-MinNumber)+MinNumber;
            String StringEditNum= editTextNum.getText().toString();
            int EditNum = Integer.parseInt(StringEditNum);
            if (EditNum >RanNum){
                textViewStatus.setText("Enter Higher Number");
            }
            else if(EditNum <RanNum){
                textViewStatus.setText("Enter Lower Numer!");

            }
            else if (StringEditNum.equals("")){
                Toast.makeText(MainActivity.this,"Error!",Toast.LENGTH_SHORT).show();
            }
            else {
                textViewStatus.setText("You won! You Nutz!");
            }

        }

        @Override
        public void afterTextChanged(Editable editable) {

        }
    });

}

@Override
protected void onStop() {
    super.onStop();
}

@Override
protected void onDestroy() {
    super.onDestroy();
}
}

```

After I debugged I get this: 

> 
> E/AndroidRuntime: FATAL EXCEPTION: main
>  Process: com.example.user.ggame, PID: 3291
>  java.lang.NumberFormatException: For input string: ""
>  at java.lang.Integer.parseInt(Integer.java:620)
>  at java.lang.Integer.parseInt(Integer.java:643)
>  at com.example.user.ggame.MainActivity$2.onTextChanged(MainActivity.java:71)
>  at android.widget.TextView.sendOnTextChanged(TextView.java:9359)
>  at android.widget.TextView.handleTextChanged(TextView.java:9446)
>  at android.widget.TextView$ChangeWatcher.onTextChanged(TextView.java:11904)
>  at android.text.SpannableStringBuilder.sendTextChanged(SpannableStringBuilder.java:1252)
>  at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:573)
>  at android.text.SpannableStringBuilder.delete(SpannableStringBuilder.java:229)
>  at android.text.SpannableStringBuilder.delete(SpannableStringBuilder.java:227)
>  at android.text.method.BaseKeyListener.backspaceOrForwardDelete(BaseKeyListener.java:370)
>  at android.text.method.BaseKeyListener.backspace(BaseKeyListener.java:71)
>  at android.text.method.BaseKeyListener.onKeyDown(BaseKeyListener.java:479)
>  at android.text.method.NumberKeyListener.onKeyDown(NumberKeyListener.java:148)
>  at android.widget.TextView.doKeyDown(TextView.java:7316)
>  at android.widget.TextView.onKeyDown(TextView.java:7093)
>  at android.view.KeyEvent.dispatch(KeyEvent.java:2688)
>  at android.view.View.dispatchKeyEvent(View.java:11662)
>  at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1827)
>  at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1827)
>  at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1827)
>  at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1827)
>  at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1827)
>  at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1827)
>  at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1827)
>  at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:437)
>  at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1818)
>  at android.app.Activity.dispatchKeyEvent(Activity.java:3252)
>  at android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:534)
>  at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:58)
>  at android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:316)
>  at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:351)
>  at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4714)
>  at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4586)
>  at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4128)
>  at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4181)
>  at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4147)
>  at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4274)
>  at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4155)
>  at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4331)
>  at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4128)
>  at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4181)
>  at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4147)
>  at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4155)
>  at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4128)
>  at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4181)
>  at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4147)
>  at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4307)
>  at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:4468)
>  at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2435)
>  at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1998)
>  E/AndroidRuntime: at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1989)
>  at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2412)
>  at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
>  at android.os.MessageQueue.nativePollOnce(Native Method)
>  at android.os.MessageQueue.next(MessageQueue.java:325)
>  at android.os.Looper.loop(Looper.java:142)
>  at android.app.ActivityThread.main(ActivityThread.java:6541)
>  at java.lang.reflect.Method.invoke(Native Method)
>  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
>  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
> 
> 
>