title: How to allow the first digit in EditText to be a zero (Android)
body: <p>I have an EditText for the user to input phone number, which is later saved to sharedpreferences. But EditText seems to remove the first digit if it is a 0, which I don't want. How do I allow the first number to be 0? I have tried using android:digits="0123456789", android:inputType="phone" and android:inputType="number". XML:  </p>
  
  <pre><code>       &lt;EditText
      android:id="@+id/etAnnonsNr"
      android:layout_width="fill_parent"
      android:layout_height="25sp"
      android:layout_alignLeft="@+id/etAnnonsText"
      android:layout_below="@+id/etAnnonsText"
      android:layout_marginTop="15dp"
      android:background="@drawable/boxboarder"
      android:nextFocusDown="@+id/etAnnonsPris"
      android:hint="Ditt telefonnummer"
      android:inputType="number" /&gt;
  </code></pre>
  
  <p>Java: </p>
  
  <p><code>final EditText etAnnonsNr = (EditText)findViewById(R.id.etAnnonsNr);</code></p>
  
  <pre><code>if (etAnnonsNr.getText().toString().matches("")){
                  editor.putInt("AnnonsNr", 0);
              }else{
                  editor.putInt("AnnonsNr", Integer.parseInt(etAnnonsNr.getText().toString()));
              }
  editor.commit();
  </code></pre>