0

In my application when i click the textfield the keyboard is showing, Up next the text field there is a button.On tap the button shows the actionsheet but the key board is not hiding,Actionsheet shows behind the keyboard

Here the code for actionsheet

   if (bval == "productpic") {
                if (!this.actions) {
                    this.actions = Ext.Viewport.add({
                        xtype: 'actionsheet',
                        style: 'background:#f3f3f3;',
                        items: [{
                            xtype: 'button',
                            ui: 'normal',
                            text: 'Take Photo',
                            scope: this,
                            handler: function () {
                                this.actions.hide();
                                capturePhoto();
                            }
                        }, {
                            xtype: 'button',
                            ui: 'normal',
                            text: 'Choose Existing Photo',
                            scope: this,
                            handler: function () {
                                this.actions.hide();
                                getPhoto(pictureSource.PHOTOLIBRARY);
                            }
                        }, {
                            xtype: 'button',
                            ui: 'decline',
                            text: 'Cancel',
                            scope: this,
                            handler: function () {
                                this.actions.hide();
                            }
                        }]
                    });
                }

Manifest details

android:hardwareAccelerated="true"
android:versionCode="1"
android:versionName="1.0"
android:windowSoftInputMode="stateAlwaysHidden" >

How to hide the key board on button tap in phonegap based android applciation?please help me out

ioseve
  • 145
  • 2
  • 14

1 Answers1

0

In the onCLick() event, put

InputMethodManager imm = (InputMethodManager)getSystemService( Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);

Where myEditText is the textfield causing the keyboard to show

Source

Community
  • 1
  • 1
doydoy
  • 3,464
  • 3
  • 17
  • 32