Android : How to disable Keyboard or making enable only the numeric in EditText onClick

user3764346

I'am having EditText in my application which is to display DatePicker. I'am seeing the keyboard when i click the EditText and if i again click the EditText strongly then my DatePicker is coming. I don't want to show the keyboard to the user. How can i achieve this scenario?

This is my code.

dataandtime = new EditText(getActivity());
     dataandtime.setLayoutParams(params1);
     dataandtime.setWidth(1000);
     dataandtime.setTextAppearance(context, android.R.style.TextAppearance_Medium);
     dataandtime.setHint("Set Date and Time");
     dataandtime.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            TimePickerDialog tpd = new TimePickerDialog(context, mTimeSetListener, mhour, mminute, false);
            tpd.show();
            DatePickerDialog dpd = new DatePickerDialog(context,
                    mDateSetListener, myear, mmonth, mday);
            dpd.show();

        }
    });
Ismael Di Vita

To set your EditText only numeric use this in your Java:

   dataandtime.setInputType(InputType.TYPE_NUMBER_VARIATION_NORMAL);

or this in your XML:

   android:inputType="number"

To disable the keyboard, try this in your activity's declaration in ManifestFile:

   <activity
        android:name=".YourActivity"
        ...
        android:windowSoftInputMode="stateAlwaysHidden" >
   </activity>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Android : How to disable Keyboard or making enable only the numeric in EditText onClick

From Dev

enable and disable the edittext in android onclick of CheckBox

From Dev

How to enable or disable incognito keyboard programmatically in android?

From Dev

How to disable and enable keyboard in ubuntu?

From Dev

How to disable and enable keyboard in ubuntu?

From Dev

How to enable and disable onclick event

From Dev

Android EditText force numeric keyboard but allow non-numeric chars

From Dev

Edittext field enable and disable using button in Android

From Dev

Enable/Disable Android virtual keyboard with dummy textarea

From Dev

making an onscreen numeric keyboard

From Dev

How to disable the keyboard's numeric keypad?

From Dev

EditText with numeric keyboard and comma

From Dev

How to display android numeric keyboard?

From Dev

how to set button disable/enable only in the specific date in android?

From Dev

How to disable and then enable onclick event on <div> with javascript

From Java

how to disable spellcheck Android edittext

From Dev

How to enable function keys on external keyboard only?

From Dev

disable / enable addeventlistener onclick

From Dev

How to create an EditText that goes up with the Keyboard on Android

From Dev

How to have an EditText stuck to the soft keyboard in Android

From Dev

How to disable the default keyboard in EditText, allowing the other actions

From Dev

Making an EditText field accept only letters and white spaces in Android

From Dev

Android EditText inputType="numberDecimal" only shows correct keyboard on second tap

From Dev

Hide Android soft keyboard and only allow digits on EditText

From Dev

How to disable backspace behaviour in EditText Android?

From Dev

How to disable autocomplete closing parenthesis in android EditText

From Dev

How to disable backspace behaviour in EditText Android?

From Dev

How to disable autocomplete closing parenthesis in android EditText

From Dev

Android custom numeric keyboard

Related Related

  1. 1

    Android : How to disable Keyboard or making enable only the numeric in EditText onClick

  2. 2

    enable and disable the edittext in android onclick of CheckBox

  3. 3

    How to enable or disable incognito keyboard programmatically in android?

  4. 4

    How to disable and enable keyboard in ubuntu?

  5. 5

    How to disable and enable keyboard in ubuntu?

  6. 6

    How to enable and disable onclick event

  7. 7

    Android EditText force numeric keyboard but allow non-numeric chars

  8. 8

    Edittext field enable and disable using button in Android

  9. 9

    Enable/Disable Android virtual keyboard with dummy textarea

  10. 10

    making an onscreen numeric keyboard

  11. 11

    How to disable the keyboard's numeric keypad?

  12. 12

    EditText with numeric keyboard and comma

  13. 13

    How to display android numeric keyboard?

  14. 14

    how to set button disable/enable only in the specific date in android?

  15. 15

    How to disable and then enable onclick event on <div> with javascript

  16. 16

    how to disable spellcheck Android edittext

  17. 17

    How to enable function keys on external keyboard only?

  18. 18

    disable / enable addeventlistener onclick

  19. 19

    How to create an EditText that goes up with the Keyboard on Android

  20. 20

    How to have an EditText stuck to the soft keyboard in Android

  21. 21

    How to disable the default keyboard in EditText, allowing the other actions

  22. 22

    Making an EditText field accept only letters and white spaces in Android

  23. 23

    Android EditText inputType="numberDecimal" only shows correct keyboard on second tap

  24. 24

    Hide Android soft keyboard and only allow digits on EditText

  25. 25

    How to disable backspace behaviour in EditText Android?

  26. 26

    How to disable autocomplete closing parenthesis in android EditText

  27. 27

    How to disable backspace behaviour in EditText Android?

  28. 28

    How to disable autocomplete closing parenthesis in android EditText

  29. 29

    Android custom numeric keyboard

HotTag

Archive