title: Button is not doing anything
body: <p>I'm trying to make a converter which can convert mile to km and vice versa, now the problem is whenever I'm clicking the button nothing is happening. The values just stayed the same whatsoever.</p>
  
  <p>My Code is:</p>
  
  <pre><code>import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.Button;
  import android.widget.EditText;
  
  
  public class Distance extends Fragment {
  
  
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          View v = inflater.inflate(R.layout.activity_distance, container, false);
          Button button = (Button) v.findViewById(R.id.button12);
          final EditText editText = (EditText) v.findViewById(R.id.edittext1);
          final EditText editText2 = (EditText) v.findViewById(R.id.edittext2);
          button.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  if (editText.getText() != null &amp;&amp; editText2.getText() == null) {
                      String s = editText.getText().toString();
                      Double d = Double.parseDouble(s) * 0.621371;
                      editText2.setText(d.toString());
                  } else if (editText2.getText() != null &amp;&amp; editText.getText() == null) {
                      String s = editText2.getText().toString();
                      Double d = Double.parseDouble(s) / 0.621371;
                      editText.setText(d.toString());
                  }
  
              }
          });
          return v;
      }
  
  
  }
  </code></pre>