android-edittext

Show a drop down list of recently entered text when clicks on an android edit box

萝らか妹 提交于 2020-01-03 17:30:33
问题 I have to show a drop down list of recently typed texts when the user edits the text.Example is the login pages shows previously logged in users 回答1: You are looking for the AutoCompleteTextView http://developer.android.com/reference/android/widget/AutoCompleteTextView.html Create a list of logins When a user logs in, you need to save that login to some sort of persistent storage (database, text file). Creating a auto complete list Everytime you create the form with the EditText login Extract

Scroll RecyclerView up accordingly when keyboard opens

扶醉桌前 提交于 2020-01-03 17:30:30
问题 I have created a chat activity and like facebook messenger, there is an EditText at the bottom and above is the RecyclerView of messages. When Keyboard opens, I want to scroll RecyclerView up exactly how much it should scroll up. To be more specific, lets assume there are 5 messages in the RecyclerView and currently 3rd message is just above the EditText. So when keyboard is open, I want to keep 3rd message just above the EditText like before. I have searched but could not find. If this is a

EditText is covered by Keyboard

巧了我就是萌 提交于 2020-01-03 17:24:33
问题 I am having a EditText in the hierarchy of <CoordinateLayout> ... <NestedScrollView> ... <RelativeLayout> <!-- This is inside an included xml layout --> ... <EditText android:id="@+id/rateCalculator" android:layout_width="wrap_content" android:layout_height="48dp" android:background="@color/colorPrimary" android:inputType="number" android:maxLength="5" android:gravity="center" android:textColor="#FFFFFF" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android

Validation on EditText in alertDialog

依然范特西╮ 提交于 2020-01-03 16:52:38
问题 I am trying to add empty field validations on EditText on AlertDialog . But even after field is empty error message is not getting displayed, instead AlertDialog is closing. But if conditions are working well as I'm not able to do post operations if any of the field is empty. Here is my Java Sample code: public class TourActivity extends AppCompatActivity { private LayoutInflater inflater; private FloatingActionButton fab; @Override protected void onCreate(Bundle savedInstanceState) { super

Android: Displaying WhiteSpace When Closing Soft Keyboard

六眼飞鱼酱① 提交于 2020-01-03 15:33:25
问题 I have a layout which contains a ListView and a EditText below the ListView which is used for searching in list view. The problem is that when i close the soft keyboard after a search, it gives a jerk and shows white space while closing the soft keyboard. I have tried adjustPan, but it moves the whole layout up. 回答1: public static void hideKeyboard(Context context,View v) { InputMethodManager imm = (InputMethodManager)context.getSystemService( Context.INPUT_METHOD_SERVICE); imm

Android. onEditorAction never called

大憨熊 提交于 2020-01-03 09:20:06
问题 I'm trying to catch the event of removing keyboard from the screen and i'm using OnEditorActionListener class. However, its onEditorAction method never gets called. This is my EditText in XML: <EditText android:id="@+id/editTextSearch" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="20dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="50dp" android:layout_weight="0.05" android:background="@color

how can i change the EditText cursor knob color android (not the cursor color the knob)

岁酱吖の 提交于 2020-01-03 09:16:14
问题 I am trying to change my EditText cursor knob but failing to see it on a device, attached is my XML for this layout <EditText android:id="@+id/new_text_edit_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerVertical="true" android:imeOptions="flagNoExtractUi" android:layout_marginLeft="16dp" android:layout_toLeftOf="@+id/new_text_button_send" android:background="@android:color/white" android:hint="@string/write_a_message" android:textSize="

How do you reduce space between floating editText hint and editText box in Android?

℡╲_俬逩灬. 提交于 2020-01-03 07:19:13
问题 I have an EditText with a floating hint but I was wondering how I would reduce the space between the floating hint and the EditText box. Right now my UI looks like http://imgur.com/9hQzzx4 and I want to reduce the space between the "Title" floating hint and the EditText box. Here's the code to my xml file <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"

set text on dynamically created edittext in android?

孤者浪人 提交于 2020-01-03 05:06:12
问题 hai am new in android i have created a dynamically button and edit text creation i have two pages 1 for entering how many button and edit text should be created. (in that page ihave only one edit text filed and button if i enter 3 .three edittext and 3 button will create on next page dynamically) if i press three the next page will be like three button and three edittext i have want to print hello on the first edit text on pressing enter ur1st time button but when i press that button the

Text watcher in Android

风流意气都作罢 提交于 2020-01-03 03:07:14
问题 I have a program where i have an editText . I want to implement TextWatcher to reflect the changes in the total edittext. I want to show the alert dialog when editbox reach the max character limit 10. When i implement Text watcher it works but it show two alert box when it reach 10 character. here is my code private TextWatcher mTextEditorWatcher = new TextWatcher() { public void beforeTextChanged(CharSequence s, int start, int count, int after) { } public void onTextChanged(CharSequence s,