title: Cannot type in EditText when it's in a custom dialog
body: <p>I'm trying to get some numbers as user input from a custom dialog. I used an <code>edittext</code> for this purpose. when <code>edittext</code> is clicked the soft keyboard pops up normally, but when I'm trying to type numbers it won't show anything in <code>edittext</code>. only the decimal point <code>.</code> can be typed.</p>
  <p>I've also tried this without limiting characters to numbers, and I've got a weird result, in this case, I can type all characters to <code>edittext</code>, but <code>backspace</code> only works on non-number characters, when I type numbers <code>backspace</code> won't remove them. this problem only happens in the dialog and not in <code>activities</code> or <code>fragments</code>.
  what am i doing wrong?</p>
  <p>Also i have to mention that I'm using English keyboard.</p>
  <p><em><strong>custom dialog layout:</strong></em></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  
  &lt;androidx.cardview.widget.CardView xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:layout_centerInParent=&quot;true&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      android:layout_gravity=&quot;center&quot;
      android:layout_width=&quot;@dimen/_180sdp&quot;
      android:layout_height=&quot;@dimen/_130sdp&quot;
      android:theme=&quot;@style/Theme.Trading.main_background&quot;
      app:cardCornerRadius=&quot;@dimen/_15sdp&quot;&gt;
  
      &lt;RelativeLayout
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          android:theme=&quot;@style/Theme.Trading.main_background&quot;&gt;
  
          &lt;ImageView
              android:layout_width=&quot;@dimen/_15sdp&quot;
              android:layout_height=&quot;@dimen/_15sdp&quot;
              android:background=&quot;@drawable/ic_up_down&quot;
              android:backgroundTint=&quot;@color/gray_1&quot;
              android:alpha=&quot;0.5&quot;
              android:layout_marginTop=&quot;@dimen/_17sdp&quot;
              android:layout_marginStart=&quot;@dimen/_27sdp&quot;/&gt;
  
          &lt;RelativeLayout
              android:background=&quot;@drawable/border_spinner&quot;
              android:layout_marginTop=&quot;@dimen/_15sdp&quot;
              android:layout_marginStart=&quot;@dimen/_55sdp&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;&gt;
  
              &lt;Spinner
                  android:theme=&quot;@style/Theme.Trading.main_textview&quot;
                  android:spinnerMode=&quot;dropdown&quot;
                  android:backgroundTint=&quot;@color/purple_1&quot;
                  android:id=&quot;@+id/alarm_spinner&quot;
                  android:layout_width=&quot;@dimen/_90sdp&quot;
                  android:layout_height=&quot;@dimen/_20sdp&quot; /&gt;
  
  
  
          &lt;/RelativeLayout&gt;
  
  
          &lt;ImageView
              android:layout_width=&quot;@dimen/_20sdp&quot;
              android:layout_height=&quot;@dimen/_20sdp&quot;
              android:background=&quot;@drawable/ic_money&quot;
              android:backgroundTint=&quot;@color/gray_1&quot;
              android:alpha=&quot;0.5&quot;
              android:layout_marginTop=&quot;@dimen/_53sdp&quot;
              android:layout_marginStart=&quot;@dimen/_25sdp&quot;/&gt;
  
          &lt;EditText
              android:imeOptions=&quot;actionNext&quot;
              android:textColor=&quot;@color/gray_1&quot;
              android:inputType=&quot;numberDecimal&quot;
              android:textSize=&quot;@dimen/_10sdp&quot;
              android:layout_marginTop=&quot;@dimen/_48sdp&quot;
              android:layout_marginStart=&quot;@dimen/_55sdp&quot;
              android:layout_width=&quot;@dimen/_90sdp&quot;
              android:layout_height=&quot;wrap_content&quot;/&gt;
  
          &lt;ImageView
              android:layout_width=&quot;@dimen/_20sdp&quot;
              android:layout_height=&quot;@dimen/_20sdp&quot;
              android:background=&quot;@drawable/ic_symbol&quot;
              android:backgroundTint=&quot;@color/gray_1&quot;
              android:alpha=&quot;0.5&quot;
              android:layout_marginTop=&quot;@dimen/_89sdp&quot;
              android:layout_marginStart=&quot;@dimen/_25sdp&quot;/&gt;
  
  
  
  
  
      &lt;/RelativeLayout&gt;
  
  &lt;/androidx.cardview.widget.CardView&gt;
  </code></pre>
  <p><em><strong>and i show this dialog ti user with code below:</strong></em></p>
  <pre><code>    public void showDialog(){
          final Dialog dialog = new Dialog(this);
          dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
          dialog.setCancelable(false);
          dialog.setContentView(R.layout.dialog_add_alarm);
          dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
  
  
          dialog.setOnKeyListener(new Dialog.OnKeyListener() {
  
              @Override
              public boolean onKey(DialogInterface arg0, int keyCode,
                                   KeyEvent event) {
                  // TODO Auto-generated method stub
                  if (keyCode == KeyEvent.KEYCODE_BACK) {
                      dialog.dismiss();
                  }
                  return true;
              }
          });
  
          dialog.show();
  
      }
  </code></pre>