Tag: android-edittext

EditText inside ListView lost focus

This question already has an answer here: Focusable EditText inside ListView 12 answers

How to handle the “paste” event in Android 3.0(Honeycomb)?

I have a customized EditText, which need to do customized “paste“. I overrode onTextContextMenuItem(int id) to handle “paste” requested by selecting context menu. @Override public boolean onTextContextMenuItem(int id) { switch(id){ case android.R.id.paste: doMyPaste(); return true; } } This works in Android before 3.0. In 3.0, however, there is a small “paste” widget near the cursor […]

Custom EditText not working after setting its input type through setInputType()

I have created a custom EditText, and have its onDraw() function overridden. Everything was working fine (I could draw anything inside the EditText) until I wanted to change the input method for this EditText and have called this function: setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL); No matter when and where I call it: after it has been called, […]

In an EditText, is there a way to disable the autocorrect on a span?

I’ve got an EditText that can have custom spans and I don’t want them to be part of the spell check. I know I could use the flag android:inputType=textNoSuggestions to completely disable the suggestions but I would like to handle it based on the position of the cursor and if it’s focusing my span or […]

Android – prevent edittext copy/paste and double tap select all

This question already has an answer here: Android, how do I stop a pointer appearing below an EditText 4 answers

Showing edittext obliquely in android

I have an EditText, which generally shows parallel to the screen X-axis. I want to show it obliquely (around 45 degree to horizontal axis). Is it possible to do this in Android. Please guide me in a direction so that I can try for it. After getting the two links in the answer by pawelzeiba, […]

EditText Selection Anchors Missing

I’ve just noticed that all my EditText fields in my app do not show the selection anchors correctly. For example: However, what I expect is the correct anchors to appear such as: A typical example of an affected EditText in my app: <EditText android:id=”@+id/text_message” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:layout_toLeftOf=”@id/button_send” android:layout_marginLeft=”@dimen/activity_horizontal_margin” android:paddingTop=”@dimen/activity_vertical_margin” android:paddingBottom=”@dimen/activity_vertical_margin” android:inputType=”text|textShortMessage” android:layout_marginRight=”4dp” android:hint=”@string/hint_chat_send” /> Also […]

Android setError() message scrolling on top of ActionBar

My issue is that the error message in my EditTexts are scrolling on top of the action bar. Is this an android bug, or am I doing something wrong? Also this bug happens even when the keyboard is down, it just happens to be up in the screenshots. Here is what I am talking about: […]

Spelling suggestions give redundant values with android.text.TextWatcher

I’m using the android.text.TextWatcher interface to listen to changes on an EditText in one of my apps. I monitor the changes to allow Undo options, using the beforeTextChanged() and onTextChanged(). Usually, changes happens one character at a time, for instance if the user types “hello”, i’ll get the following values for the start, after and […]

Android – Capture “Done” and “Enter” key events on soft keyboard

I have a Login page in my app where there are elements as listed: username (EditText) password (EditText) Login (Button) On pressing Login, it will land into the main screen. The intention is to perform that same action when the user hits Done at the completion of keying in the password on soft keyboard on […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.