title: Handle exception of Blanked EditText and EditText With Character?(better get in disrciption)
body: <p>I created an application for the converting Currency from Dollar to Rupee. As I entered the amount in the dollar it converts to Rupee after pressing the <code>button</code>. The <code>Variable</code> type of resulted amount is <code>double</code>. Now if I Entered the <code>character</code>  in The EditText instead of Number and press the <code>button</code> the Application gets Crashed. The Same thing is happening when I keep the EditText blank and press the <code>button</code>. It is obvious that we can not convert the character into <code>double</code> i.e Rupee. Now How to handle these <code>Run Time Errors</code> by keeping about application not getting a crashed. I tried to search the similar question but not get satisfied with that. (Ask me for Extra information regarding question if you need).</p>
  
  <blockquote>
    <p>ActivityMain.java</p>
  </blockquote>
  
  <pre><code>           package com.example.admin.convertcurrency;
  
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.View;
  import android.widget.EditText;
  import android.widget.RelativeLayout.LayoutParams;
  import android.widget.Toast;
  import java.util.InputMismatchException;
  
  public class MainActivity extends AppCompatActivity {
  
      public void ButtonClicked(View view) {
  
  
  
              EditText EnteredAmount = (EditText) findViewById(R.id.EnteredAmount);
  
  
              Log.i("Amount Entered", EnteredAmount.getText().toString());
  
              Double ConvertedAmount = (Double.parseDouble(EnteredAmount.getText().toString()));
              Double Rupees = ConvertedAmount * 71.64;
  
  
              Log.i("Converted Amount", String.valueOf(Rupees));
  
  
              Toast.makeText(MainActivity.this, String.format("%.2f",Rupees) + "Rs", Toast.LENGTH_SHORT).show();
  
  
  
          Toast.makeText(MainActivity.this, "Please Enter The Number Instead..!", Toast.LENGTH_SHORT).show();
  
      }
  </code></pre>
  
  <blockquote>
    <p>LogCat Error Log(After typed Single "A" character in EditText)</p>
  </blockquote>
  
  <pre><code>09-09 20:30:54.415 30894-30894/com.example.admin.convertcurrency E/AndroidRuntime: FATAL EXCEPTION: main
      Process: com.example.admin.convertcurrency, PID: 30894
      java.lang.IllegalStateException: Could not execute method for android:onClick
          at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:389)
          at android.view.View.performClick(View.java:5215)
          at android.view.View$PerformClick.run(View.java:21196)
          at android.os.Handler.handleCallback(Handler.java:742)
          at android.os.Handler.dispatchMessage(Handler.java:95)
          at android.os.Looper.loop(Looper.java:157)
          at android.app.ActivityThread.main(ActivityThread.java:5603)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)
       Caused by: java.lang.reflect.InvocationTargetException
          at java.lang.reflect.Method.invoke(Native Method)
          at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:384)
          at android.view.View.performClick(View.java:5215) 
          at android.view.View$PerformClick.run(View.java:21196) 
          at android.os.Handler.handleCallback(Handler.java:742) 
          at android.os.Handler.dispatchMessage(Handler.java:95) 
          at android.os.Looper.loop(Looper.java:157) 
          at android.app.ActivityThread.main(ActivityThread.java:5603) 
          at java.lang.reflect.Method.invoke(Native Method) 
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774) 
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652) 
       Caused by: java.lang.NumberFormatException: Invalid double: "a"
          at java.lang.StringToReal.invalidReal(StringToReal.java:63)
          at java.lang.StringToReal.initialParse(StringToReal.java:164)
          at java.lang.StringToReal.parseDouble(StringToReal.java:282)
          at java.lang.Double.parseDouble(Double.java:301)
          at com.example.admin.convertcurrency.MainActivity.ButtonClicked(MainActivity.java:44)
          at java.lang.reflect.Method.invoke(Native Method) 
          at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:384) 
          at android.view.View.performClick(View.java:5215) 
          at android.view.View$PerformClick.run(View.java:21196) 
          at android.os.Handler.handleCallback(Handler.java:742) 
          at android.os.Handler.dispatchMessage(Handler.java:95) 
          at android.os.Looper.loop(Looper.java:157) 
          at android.app.ActivityThread.main(ActivityThread.java:5603) 
          at java.lang.reflect.Method.invoke(Native Method) 
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774) 
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652) 
  </code></pre>
  
  <p> </p>
  
  <blockquote>
    <p>LogCat Error Log(After keeping the EditText as blank)</p>
  </blockquote>
  
  <pre><code> 09-09 19:00:44.031 8951-8951/com.example.admin.convertcurrency E/AndroidRuntime: FATAL EXCEPTION: main
      Process: com.example.admin.convertcurrency, PID: 8951
      java.lang.IllegalStateException: Could not execute method for android:onClick
          at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:389)
          at android.view.View.performClick(View.java:5215)
          at android.view.View$PerformClick.run(View.java:21196)
          at android.os.Handler.handleCallback(Handler.java:742)
          at android.os.Handler.dispatchMessage(Handler.java:95)
          at android.os.Looper.loop(Looper.java:157)
          at android.app.ActivityThread.main(ActivityThread.java:5603)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)
       Caused by: java.lang.reflect.InvocationTargetException
          at java.lang.reflect.Method.invoke(Native Method)
          at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:384)
          at android.view.View.performClick(View.java:5215) 
          at android.view.View$PerformClick.run(View.java:21196) 
          at android.os.Handler.handleCallback(Handler.java:742) 
          at android.os.Handler.dispatchMessage(Handler.java:95) 
          at android.os.Looper.loop(Looper.java:157) 
          at android.app.ActivityThread.main(ActivityThread.java:5603) 
          at java.lang.reflect.Method.invoke(Native Method) 
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774) 
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652) 
       Caused by: java.lang.NumberFormatException: Invalid double: ""
          at java.lang.StringToReal.invalidReal(StringToReal.java:63)
          at java.lang.StringToReal.parseDouble(StringToReal.java:267)
          at java.lang.Double.parseDouble(Double.java:301)
          at com.example.admin.convertcurrency.MainActivity.ButtonClicked(MainActivity.java:23)
          at java.lang.reflect.Method.invoke(Native Method) 
          at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:384) 
          at android.view.View.performClick(View.java:5215) 
          at android.view.View$PerformClick.run(View.java:21196) 
          at android.os.Handler.handleCallback(Handler.java:742) 
          at android.os.Handler.dispatchMessage(Handler.java:95) 
          at android.os.Looper.loop(Looper.java:157) 
          at android.app.ActivityThread.main(ActivityThread.java:5603) 
          at java.lang.reflect.Method.invoke(Native Method) 
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774) 
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)
  </code></pre>