android-edittext

Edittext “lag” android

醉酒当歌 提交于 2019-12-06 10:44:30
The first time i focus an edittext view i notice a lag of one or two seconds before i can write anything in the textbox. I notice this behavior even on an app without any code more than what's nessecary to initialize the application. What am i doing wrong? I've INSTANTLY fixed this issue for me; I saw in the DDMS that a lot of redraw's and recalculations were occurring while entering text, and a lot of info about RelativeLayouts were being called. So, I checked my layout; i had some Multi-Line EditText's who were direct children of a RelativeLayout. So, I wrapped those up into a Linear Layout,

Block physical keyboard input in EditText

て烟熏妆下的殇ゞ 提交于 2019-12-06 10:21:38
问题 I have a EditText that should not allow the user to input anything through the keyboard (soft or hard). This EditText should only allow the user to input something through keys(buttons) displayed in the screen by the app. I have disabled the soft keyboard, but I can't find a way to disable the hardware keyboard input. This input via hardware keyboard can be done using a emulator that is configured to allow input through the hardware keyboard. So, my question is, How can I block the input via

How to automatically show soft keyboard on start?

纵饮孤独 提交于 2019-12-06 09:55:15
问题 I have an activity that only has a EditText. I want the soft keyboard to show up automatically. How can I do this? 回答1: You can use this onResume: InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(((EditText) findViewById(R.id.your_view)),InputMethodManager.SHOW_FORCED); I suggest that you check if there is a Hardware keyboard before you force the keyboard to appear. To hide: ((InputMethodManager) YourActivity.this.getSystemService

Having the mandatory symbol to the edit text (red color asterisk) which is inside the textinputlayout

半城伤御伤魂 提交于 2019-12-06 09:53:36
问题 I have an edit text inside a textinputlayout. I am trying to set the mandatory field symbol (red color asterisk) to the edittext. I have set the hint to the edit text. My code is as below. <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginLeft="16dp" android:layout_marginTop="16dp" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" * " android:layout

EditText word wrap

我只是一个虾纸丫 提交于 2019-12-06 09:40:24
问题 I have this layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@id/container" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:padding="@dimen/activity_horizontal_margin" > <LinearLayout android:id="@+id/header" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <EditText android:id="@+id/editText" android:layout_width="match

how to enable vertical scrollbar of an edittext programmatically

孤者浪人 提交于 2019-12-06 08:54:07
问题 I'm trying to implement android:scrollbars="vertical" in XML by Java code. I've tried method setVerticalScrollBarEnabled(true) but it doesn't work. Anyone can give me a suggestion? Thanks in advance. 回答1: you can use EditText ed=new EditText(context); ed.setScroller(new Scroller(context)); ed.setVerticalScrollBarEnabled(true); this will give the scroll option for the edit text but it won't show the scroll bar. 来源: https://stackoverflow.com/questions/8417454/how-to-enable-vertical-scrollbar-of

EditText data is lost on rotating the device

筅森魡賤 提交于 2019-12-06 08:30:01
OK guys, I am done with it. I have been googling for last 2 days but I can't find the exact solution. Everyone is talking about configChanges and all those cliche things which do not seem to work in my case . I have a login screen which consists of 2 EditTexts. Now this login screen has different layout for both Portrait and Landscape orientation . So I had to create one login.xml in layout folder and another login.xml in layout-land folder. And to support orientation changes I overrid onConfigurationChanged() method in LoginActivity class. In this method I call setContentView(R.layout.login)

How to possible page curl with textView in android?

梦想的初衷 提交于 2019-12-06 08:22:52
问题 I found the good harism's project that allows a beautiful paging effect like following link https://github.com/harism/android_page_curl. But works only images,My requirement is to use editText through write data and also save So,kindly give me Suggestion or code. I also visit bellow given link: Android page curl by harism , adding TextView caused and exception : But above link use textView not Edit Text. 回答1: it is so simple. Just replace the loadBitmap method in the CurlActivity with the

Android - Unexpected Behavior of Keypad - EditText in ListView

无人久伴 提交于 2019-12-06 08:22:42
问题 I am stuck with problem since last two days i.e. i have created ListView with Custom View with Variant SubLayout like: Problems: When i click on EditText of Qty , its displaying Soft Input Keyboard with Numeric Keypad and immediately focus lost from edittext with change of alphabetic keypad. (First ScreenShot Below) on Second time focus of EditText its works fine and taking numeric values but while scrolling its change keypad from numeric to alphabetic. (Second ScreenShot Below) Actually i

Android Create aligned fields Layout

一世执手 提交于 2019-12-06 08:14:01
Here's my issue I have a login and want to line up the EditText fields. See the mockup picture attached . I have tried a few ways and cannot figure out how to make the fields lineup. I really hate layouts in Android I spend more time just messing with things to line up right. Wish they would just scrap it and use something more intuitive, as its more like using tables in HTML. So in advance thanks for your help and cheers! You could probably play around with RelativeLayout and get just what you want. Here's an approximation with TableLayout . <?xml version="1.0" encoding="utf-8"?>