0

I have an EditText set as android:inputType="number" and have a hint string set on it. The issue is that when running the app the text 0 is added to the edittext and the hint is not displaying.

The android:text value is not set. I have also tried to set it to empty but without any effect.

Any clue on how to solve this?

Edit: I did try and do as said in the answer in comment but doesn't work.

The code is as follows:

<EditText
        android:id="@+id/txtEngineCapacity"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:background="@drawable/maptextbox"
        android:ems="10"
        android:fontFamily="@font/lato_light"
        android:hint="@string/vehicleCC"
        android:inputType="number"
        android:textSize="18sp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/txtChassisNumber" />
Fabrizio Mazzoni
  • 1,831
  • 2
  • 24
  • 46
  • Possible duplicate of [How to add hint into EditText with inputType="numberDecimal"?](https://stackoverflow.com/questions/8156924/how-to-add-hint-into-edittext-with-inputtype-numberdecimal) – Lev Leontev May 28 '19 at 18:15
  • please add some code to your question. – YQadoome May 28 '19 at 18:18

0 Answers0