3 Replies - 280 Views - Last Post: 30 September 2019 - 08:34 PM

#1 Bobby_Bubbles   User is offline

  • D.I.C Regular

Reputation: 1
  • View blog
  • Posts: 291
  • Joined: 13-March 18

autofocus on edittext to pull numpad

Posted 26 August 2019 - 09:01 AM

exactly as the title says. When the activity loads the new xml i want it to automatically focus on the edittext and pull up the numpad.
Is This A Good Question/Topic? 0
  • +

Replies To: autofocus on edittext to pull numpad

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15277
  • View blog
  • Posts: 61,238
  • Joined: 12-June 08

Re: autofocus on edittext to pull numpad

Posted 26 August 2019 - 10:57 AM

What have you tried, look into, or attempted?
Was This Post Helpful? 0
  • +
  • -

#3 Bobby_Bubbles   User is offline

  • D.I.C Regular

Reputation: 1
  • View blog
  • Posts: 291
  • Joined: 13-March 18

Re: autofocus on edittext to pull numpad

Posted 26 August 2019 - 11:38 AM

<EditText
        android:id="@+id/eTTotal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:layout_marginStart="87dp"
        android:textColor="@android:color/white"
        android:layout_marginTop="74dp"
        android:ems="10"
        android:inputType="numberDecimal">
<requestFocus></requestFocus>
</EditText>



it focuses on the edittext but it doesnt bring up the number pad...which is what i want.

This post has been edited by Bobby_Bubbles: 26 August 2019 - 11:39 AM

Was This Post Helpful? 0
  • +
  • -

#4 wseng92   User is offline

  • D.I.C Addict
  • member icon

Reputation: 55
  • View blog
  • Posts: 706
  • Joined: 23-September 15

Re: autofocus on edittext to pull numpad

Posted 30 September 2019 - 08:34 PM

In xml
<EditText
        android:id="@+id/eTTotal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:layout_marginStart="87dp"
        android:textColor="@android:color/white"
        android:layout_marginTop="74dp"
        android:ems="10"
        android:inputType="numberDecimal">
</EditText>


Java class
editText.requestFocus();

This post has been edited by wseng92: 30 September 2019 - 08:35 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1