[android-developers] Displaying Virtual Keyboard without expanding EditText
I want to display keyboard when my app gets started. I know we can get Virtual Keyboard when clicked on EditText field, but I want to show Virtual Keyboard without clicking on EditText. Swapnil || Hare Krishna Hare Krishna Krishna Krishna Hare Hare || || Hare RamaHare Rama Rama RamaHare Hare || -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Displaying virtual keyboard
Hello! I need help with showing the integrated virtual keyboard on-screen. I extended a View class and I implemented these two methods (most of it is just stub code; for now I only want to display the keyboard): @Override public InputConnection onCreateInputConnection (EditorInfo outAttrs) { BaseInputConnection fic = new BaseInputConnection(this, true); outAttrs.actionLabel = null; outAttrs.hintText = Insert the test text; outAttrs.initialCapsMode = 0; outAttrs.initialSelEnd = outAttrs.initialSelStart = -1; outAttrs.label = Test text; outAttrs.inputType = InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL; outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE; return fic; } @Override public boolean onCheckIsTextEditor() { return true; } In the onCreate method of my activity I have : InputMethodManager imm = (InputMethodManager)this.getSystemService (Context.INPUT_METHOD_SERVICE); imm.showInputMethodPicker(); imm.showSoftInput(editor, InputMethodManager.SHOW_FORCED); Where editor is an instance of my View. I noticed in the debugger that my onCreateInputConnection() is executed but after that the keyboard is not displayed on the screen. Using the TextView widtget and it's subclasses is not an option. Thank you! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Displaying virtual keyboard in a custom View
Hello all! I am building a custom view and would like to pragmatically display the default on-screen input method (if any) when certain conditions are met. Due to some specific features of the view I am not able to reuse the TextView and EditText views with all the functionality already present. The idea was to simply display the keyboard and capture the keypress events in the view. inputMethodManager = (InputMethodManager) getSystemService ( Context.INPUT_METHOD_SERVICE ); inputMethodManager.showSoftInput ( editorView, InputMethodManager.SHOW_FORCED ); While the approach seems to work with EditText I was not able to show the on-screen keyboard ( showInputMethodPicker () seems to work ). While browsing the TextView source code I came across the following method: @Override public InputConnection onCreateInputConnection(EditorInfo outAttrs) that (basically) returns InputConnection ic = new EditableInputConnection(this); I was not able to find the class EditableInputConnection in the documentation or in the source code. I would appreciate any kind of advice on how to show the on screen keyboard and how to properly register my view so it can receive the keypress events. Many Thanks, Martin S. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---