title: redmi device restarting when trying to put creadentials in entry control in xamarin forms app
body: <p>I am getting an issue with Entry field on a particular device (Xiaomi Note7 Pro) that is when I try to put value in the entry field it will cause restart the MIUI of device (Xiaomi Note7 Pro). I have done some digging but did not find any solution yet. Please help me out with this issue.</p>
  <p>I have tried to change the keyboard types as well in entry but still didn't get any success. Below is the sample of entry control xaml:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;AbsoluteLayout&gt;
      &lt;controls:ExtEntry x:Name=&quot;txtUsername&quot; 
                         Placeholder=&quot;Username&quot; 
                         Keyboard=&quot;Email&quot; 
                         Text=&quot;{Binding Username}&quot; 
                         Style=&quot;{StaticResource EntryImage}&quot;/&gt;
      &lt;Image Source=&quot;usericon&quot;
             Style=&quot;{StaticResource RightImageIcon}&quot;/&gt;
  &lt;/AbsoluteLayout&gt;
  </code></pre>
  <p>Below is the code for my ExtEntry (Renderer):</p>
  <pre class="lang-cs prettyprint-override"><code>public class CustomEntry : EntryRenderer
  {
      ExtEntry element;
  
      public CustomEntry(Context context) : base(context)
      {
      }
  
      protected override void OnElementChanged(ElementChangedEventArgs&lt;Entry&gt; e)
      {
          base.OnElementChanged(e);
  
          if (Control == null || e.NewElement == null) return;
  
          element = (ExtEntry)this.Element;
  
          var editText = this.Control;
          if (!string.IsNullOrEmpty(element.Image))
          {
              switch (element.ImageAlignment)
              {
                  case ImageAlignment.Left:
                      editText.SetCompoundDrawablesWithIntrinsicBounds(
                          GetDrawable(element.Image), null, null, null);
  
                      break;
                  case ImageAlignment.Right:
                      editText.SetCompoundDrawablesWithIntrinsicBounds(
                          null, null, GetDrawable(element.Image), null);
  
                      break;
              }
          }
          editText.CompoundDrawablePadding = 25;
  
          // Control.Background.SetColorFilter(element.LineColor.ToAndroid(),
          //     PorterDuff.Mode.SrcAtop);
  
          Control.FocusChange += Control_FocusChange;
  
          if (element.IsBorderVisible)
          {
              GradientDrawable gd = new GradientDrawable();
              gd.SetShape(ShapeType.Rectangle);
              gd.SetCornerRadius(3);
              gd.SetStroke(3, Android.Graphics.Color.Rgb(188, 196, 205));
              Control.SetBackground(gd);
          }
  
          Control.CustomSelectionActionModeCallback = new Callback();
          Control.SetPadding(10, 5, 10, 5);
          Control.LongClickable = false;
      }
  
      protected override void OnElementPropertyChanged(object sender, 
          PropertyChangedEventArgs e)
      {
          base.OnElementPropertyChanged(sender, e);
          if (e.PropertyName.Equals(nameof(element.Image)))
          {
              var editText = this.Control;
              if (!string.IsNullOrEmpty(element.Image))
              {
                  switch (element.ImageAlignment)
                  {
                      case ImageAlignment.Left:
                          editText.SetCompoundDrawablesWithIntrinsicBounds(
                              GetDrawable(element.Image), null, null, null);
  
                          break;
                      case ImageAlignment.Right:
                          editText.SetCompoundDrawablesWithIntrinsicBounds(null, null, 
                              GetDrawable(element.Image), null);
  
                          break;
                  }
              }
              editText.CompoundDrawablePadding = 25;
          }
      }
  
      private void Control_FocusChange(object sender, FocusChangeEventArgs e)
      {
          if (Control.HasFocus)
          {
              if (element.IsBorderVisible)
              {
                  GradientDrawable gd = new GradientDrawable();
                  gd.SetStroke(3, Android.Graphics.Color.Rgb(29, 74, 147));
                  Control.SetBackground(gd);
              }
          }
          else
          {
              if (element.IsBorderVisible)
              {
                  GradientDrawable gd = new GradientDrawable();
                  gd.SetStroke(3, Android.Graphics.Color.Rgb(188, 196, 205));
                  Control.SetBackground(gd);
              }
          }
      }
  
      private Drawable GetDrawable(string imageEntryImage)
      {
          int resID = Resources.GetIdentifier(imageEntryImage, 
              &quot;drawable&quot;, this.Context.PackageName);
  
          var drawable = ContextCompat.GetDrawable(this.Context, resID);
          var bitmap = ((BitmapDrawable)drawable).Bitmap;
          Drawable d = new BitmapDrawable(Resources, Bitmap.CreateScaledBitmap(bitmap, 
              element.ImageHeight, element.ImageWidth, true));
  
          return d;
      }
  }
  </code></pre>
  <p>Please someone help me out with this issue. I have tried many things to fix this but didn't find any solution yet.</p>