Android 4.0 Next function from keyboard - android

On my edit text I put the keyboard to have the "Next" button. The problem is that when the Next button is pressed on Android 4.0 (I tested on Emulator and on a device with Android 4.0) the cursor places at the beginning of the word instead of at the end of the word. What should I do?
Thanks
NOTE: On my Motorola Defy (Android 2.2) it's working great.

You could override the onFocusChangeListener for the editText, and when the focus changes do something like this to set the cursor to the end of the text
editText.setSelection(editText.length - 1);

Related

Android 10 EditText box not updating with keyboard inputs

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

Android 8 Oreo EditText do not allow paste on long press

I have simple custom view with EditText and the copy/paste popup is not showing on Oreo. It is working on Android 7, it is even working on my Emulator running Android 8 Oreo, but it is not working on real device with Android Oreo (Google Pixel, Nexus 5X). When I long press on my custom view with EditText, the popup menu with copy/paste options is not displayed at all on real device (again, it is working on Android 7 and lower and on Emulator running Oreo). But when I fill some text in the EditText, and then do a long press, the copy/paste popup show up even on Oreo on my device.
Really weird behaviour. I copied all my logic in my custom view so just the simple EditText is there and still no result. I think that maybe it is about new auto fill feature that breaks it down?
So I found that the problem is, when the EditText has set negative side margin.
Sample layout that is not showing copy/paste popup on Android Oreo (real device only):
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="-4dp"
android:layout_marginRight="-4dp"/>
I created new issue: https://issuetracker.google.com/issues/65575880
If you have any method like this in your Application, please rename it.
protected int getUserId() {
return getCurrentUserRepository().getId();
}

EditText not deleting text on BACKSPACE in Android 4.1.2

I have a UI component that extends EditText. It watches for changes to text contents by the user with a TextWatcher.
I have a problem that only shows in Android 4.1.2:
My component (previously) selects a range of text selected programatically, using setSelection() to set start of selection and extendSelection() to extend it.
When the text is selected, the beforeTextChanged() and afterTextChanged(0 are NOT called when backspace is typed.
Entering a character at the keyboard causes the selected text range to be replaced with the type character correctly, so it appears the selection is working.
This works fine in Android 4.0.2 and other versions I have tried.
Any ideas for a workaround?
I have the same problem, the workaround I found is in the manifest, set targetSdk = 15 or lower.

Android text cursor in EditText

I'm writing an application for android 2.1+. In one of my activities i have EditText with custom keyboard (KeyboardView with key mappings in keyboard.xml). Everything works perfect on android 2.1 ( everything is shown correctly - text cursor is flashing), problems start on android 2.3.3 where textcursor in edittext is visible but not blinking, and on android 3.0+ text cursor is just invisible - in both cases keyboard is working correctly. I'm struggling with this problem from couple days... any thoughts would be really helpful.
There is one thing which i should mention earlier. This activity is split into two fragments (android support library), EditText is on one of them, and the keyboard is called from parent activity.
When i faced this problem before, the solution was to disable hardware acceleration on the activity that contains the edit text, by modifying the manifest like this:
<activity android:name="activity name" android:hardwareAccelerated="false"/>

Radio Group not getting Focus in Android

So I have a form that contains two EditText components and a RadioGroup.
When I click on one of the EditText fields the keyboard pops-out and I can right and everything is great. UNTIL I click on one of the RadioButtons and it gets clicked with the keyboard still out!! And when I use the keyboard it writes in the last focused EditText( Android 4.0) while on my Galaxy S2 (Android 2.3.6) it crashes the app!!
I researched that issue and I found that it was a known issue in (Android 2.0-) so what is wrong with what I'm doing?
I want to be able to use onFocusChange listener to validate the RadioGroup selection? Any Ideas will be appreciated.

Categories

Resources