As a noob I wrote an app with lots of layout screens and it worked OK in emulation but when I ran it on my Droid Incredible the soft keyboard popping up changed the layout of a LinearLayout I was using - shoving some elements aside and changing the height of others! I fixed it by adding android:windowSoftInputMode="adjustPanā€¯ to the Activity element of the manifest but I really would have preferred to discover this problem in emulation and not on a real phone.
So, is there a popup soft keyboard in the Emulator and if so how do I invoke it?
yes there is, you only need to click on an EditText box with your mouse and it will open.
Yes, of course. You can go to the emulator's edit page, do not choose the "Use handware keyboard".
Related
I've been thrown into trying to fix bugs in an app I didn't write, and I'm not all that familiar with Android. I'm having problems with text boxes not updating with keyboard inputs. Here's whats happening:
In android 10 (only) when I click on a text box, type stuff with the soft keyboard, nothing shows up in the textbox until the soft key board is minimized. But it works 100% fine in Android 5.1, 6, 8.1. (Also, compiling app with SDK for Android 8.1 or 10 makes no difference). The text box is never covered or hidden by the keyboard, it just remains empty until the keyboard is minimized.
The only thing that works is if I make the keyboard floating type, or if I position the textbox way at the top of the layout such that Android does not need to pan or resize the view to accommodate both the box and the default keyboard. A floating keyboard works anywhere, even partially over top of this text box.
I have tried every possible parameter combination I can find in the manifest and layout xml files, including android:windowSoftInputMode , android:fitsSystemWindows , android:isScrollContainer , android:gravity , android:paddingBottomandroid:configChanges
The fact this is -only- an issue for Android 10 is suspicious.
For anyone that finds this in the future: the issue turned out to be that hardware acceleration needed to be turned on. See EditText in Android doesn't show text when typing while using the on-screen keyboard
I have downloaded the device on genymotion that is HTC One - 4.4.4 - API-19. The problem is that the soft keyboard is not appearing at all. I have tried with the ime coding as
edPost.requestFocus();
imm.showSoftInput(edPost, 0);
Then I thought may be I am mistaking somewhere in my code. I have checked the default message app of this device where I can't see the soft keyboard to type the message or destination number. Even anywhere the keyboard may appear I can't see it at all. Please help me with any kind of knowledge about this problem. Thanks in advance.
checkmark use virtual keyboard for text input from genymotion device setting.
see attached image.
Goto Settings --> Language & Input --> Current Keyboard
Here in this dialog Turn On the "Hardware" Toggle button.
Sorry Tejas, it is not the correct answer. I have unchecked the "use virtual keyboard for text input" as you have attached on image and still able to display the soft keyboard by this way. See the below image
Thanks.
I bought an OTG cable for my LG-G2. I connected to the OTG a wireless logitech keyboard (MK 250). In my keyboard layout I got 2 Languages: English and Hebrew.
When I press SHIFT-SPACE (language change), I see on the top of the screen the EN(English layout) changes to HE(Hebrew layout) but when I press a button, it types in English while the HE is on the top of the screen. Is there is anyway that this keyboard will type in Hebrew? I tried thitd party apps but it doesn't change anything.
I solved it.
I found an app called "external keyboard helper pro". with the app I found a way to change the layout. to switch languages, I just need to change the external keyboard helper to the built in LG keyboard.
Thank you Gabe for your help.
I want to turn off displaying "Suggested Words" on the soft/virtual keyboard when someone is using my application (only on certain Activities). For the default Android keyboard, this can be found under 'Settings' (under Word Suggestion Settings).
Is there a way to disable it only within your application, without requiring the user to manually go and do it? I basically want the user to type words without providing any hints.
Thanks!
When developing for 2.0+, the supposed way is setting android:inputType="textNoSuggestions" (ref).
Unfortunately, suggestions are still shown on HTC Desire 2.2 (and probably other HTC Sense devices as well).
Using android:inputType="textVisiblePassword"will not help as well as the software keyboard by HTC won't allow you to switch languages.
So I stick to android:inputType="textFilter" to disable suggestions.
You can disable suggestions on the Soft Keyboard by adding the following line in the xml -
android:inputType="textNoSuggestions"
However according to this article, it may or may not be supported by the IME (the keyboard).
If this issue occurs, the below method works for sure -
android:inputType="textNoSuggestions|textVisiblePassword"
This works for me with the stock keyboard, even on HTC with 2.2
final EditText et = (EditText) findViewById(R.id.SearchText);
et.setInputType(et.getInputType()
| EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS
| EditorInfo.TYPE_TEXT_VARIATION_FILTER);
On my 6P running Nougat, nothing worked. While it is empty the suggestion bar stays up because it has the microphone icon on the right side.
In order to get rid of that, I used fingerup's suggestion in one of the comments and it worked!
So I decided to write an actual answer so people don't miss it.
To recap here's what I've used:
android:inputType="textNoSuggestions|textFilter|textVisiblePassword"
android:privateImeOptions="nm"
inputType="textNoSuggestions|textFilter|textVisiblePassword" prevents suggestions, and privateImeOptions="nm" (stands for "no microphone") prevents the bar from showing up because it still would since the mic button is in it.
So it is necessary to use both attributes because if all you do is specify no mic then the bar still shows up with recommendations.
Thx again to fingerup for mentioning the nm trick. ;)
There are two ways that I know of to disable the auto-complete. One way is through the XML by setting the android:inputType="textVisiblePassword" in the layout xml.
The other way is through code such as the following
EdtiText editTextBox = findViewById(R.id.myEditTextView);
editTextBox.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
I was facing the same issue on Samsung devices using:
android:inputType="textNoSuggestions|textFilter|textVisiblePassword"
only after setting the inputType to password and visiblePassword worked for me:
android:inputType="textPassword|textVisiblePassword"
android:inputType="textPhonetic" hides soft keyboard suggestions on Android 1.6.
hope this works for you,
editText.setInputType(InputType.TYPE_CLASS_TEXT|InputType.TYPE_TEXT_FLAG_CAP_SENTENCES|InputType.TYPE_TEXT_FLAG_MULTI_LINE|InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
If you are using InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS in activity, it will work fine.
In case of DialogFragment, you should place InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS at
onActivityCreated() handler as below :-
#Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
EditText editTextUsername = (EditText)dialogView.findViewById(R.id.txtUsername);
editTextUsername.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
}
I want to add some buttons on top of the soft keyboard (Enter and Cancel). Is there a nice way to do this or do I have to detect the keyboard being shown and add the buttons into my view?
I can't see the logic your trying to apply here.
if you add buttons above your keyboard then you lose some areas in your keyboard (for example you cant press on q w s a).
I think you should look into creating your own custom keyboard.
maybe this will help
android app specific soft keyboard
Jason
You won't be able to do this, and with good reason. If apps could modify an existing input method like this, they could trivially log all keystrokes on your device without you knowing. If you've ever installed a custom input method, you'll see a big warning that using it means trusting it not to log your keystrokes, and the functionality you're after would totally circumvent that protection.