android-edittext

How Show soft keyboard automatically when EditText receives focus

霸气de小男生 提交于 2019-12-08 17:38:20
问题 I want show keyboard when my EditText receives focus. I tried many methods but nothing not helped. I tried: 1. InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(yourEditText, InputMethodManager.SHOW_IMPLICIT); whith different flags. 2. getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); <requestFocus /> 4. editText.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void

EditText won't wrap its text

非 Y 不嫁゛ 提交于 2019-12-08 17:28:39
问题 I know there are lots of related questions in Stackoverflow, but I tried to do everything that's written in any of them and so far I couldn't get this working. My problem is simple. I have an android application, and I have a box where the user will input text. However, I don't want this text to be multiline (it shouldn't have "\n" in it), but I want it to wrap if the size of the line is greater than the viewport. So basically, what I want is the same behaviour that the textBox on Gmail

ClearableEditText - requestLayout() improperly called on Android 4.3

江枫思渺然 提交于 2019-12-08 17:15:47
问题 I implemented ClearableEdittext and it works perfectly except on 4.3 where the logcat floods me with: W/View(16611): requestLayout() improperly called by com.[myPackage].ui.widgets.ClearableEditText{42233dd0 VFED..CL .F....ID 0,0-708,88 #7f050127 app:id/SearchEdittext} during layout: running second layout pass W/View(16611): requestLayout() improperly called by com.[myPackage].ui.widgets.ClearableEditText{42233dd0 VFED..CL .F....ID 0,0-708,88 #7f050127 app:id/SearchEdittext} during layout:

Android password edit text showing text

浪尽此生 提交于 2019-12-08 16:22:48
问题 I have used one Edittext with attribute android:inputType="textPassword" . But when I type some text in it, text is getting visible character by character before changing to solid bullets. How can I make the text invisible as the user inputs the text. Please help me. 回答1: Try to add EditText attribute android:inputType="text" And also add programmatically edt_password.setTransformationMethod(new PasswordTransformationMethod()); 回答2: i have used the below in my application and text does not

Autofill framework updates 8.1 cause crash to EditText

孤者浪人 提交于 2019-12-08 16:09:14
问题 I updated my phone to 8.1 from 8.0 and now I am getting this crash when I am trying to tap any EditText or com.rengwuxian.materialedittext.MaterialEditText on my app (which is built with API Level 25). FATAL EXCEPTION: main java.lang.NullPointerException: activityToken at android.os.Parcel.readException(Parcel.java:2010) at android.os.Parcel.readException(Parcel.java:1950) at android.view.autofill.IAutoFillManager$Stub$Proxy.startSession(IAutoFillManager.java:381) at android.view.autofill

EditText android:hint not disappearing onFocus

南楼画角 提交于 2019-12-08 15:59:01
问题 I am on Android 4+ and I am trying to add hints to my edit text widgets. I tried adding the hint to the layout as follows... <EditText android:id="@+id/bar_name" android:layout_width="fill_parent" android:layout_height="wrap_content" android:inputType="text" android:hint="@string/bar_name_hint" /> But when I focus on the Text box it writes over the hint instead of the hint disappearing. I found documentation on adding a onFocus listener to the EditText, but I would like to avoid doing this

findViewById returns null for EditText

久未见 提交于 2019-12-08 15:58:47
问题 findViewById returns null for EditText Java Code: public class MainActivity extends Activity { private EditText editText; /** * Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); editText = (EditText) findViewById(R.id.etext); if (editText == null) { Log.v("editText", "booohooo"); } else { Log.v("editText", "Success"); } final Button button = (Button) findViewById(R.id

Adding EditText alongside RadioButton

不问归期 提交于 2019-12-08 15:45:17
问题 I have a custom DialogPreference subclass in which I would like to have a RadioGroup with three radio buttons. The first two are vanilla RadioButton components with titles, but for the third I would like to place an EditText directly to the right of it so I can enter a custom value when that button is selected. I have tried putting the third button into a horizontal LinearLayout along with the EditText but then the third button does not participate in the parent RadioGroup anymore.

EditText cursor and pointer color for below android 5.0

孤街醉人 提交于 2019-12-08 15:40:53
问题 I am trying to change EditText cursor pointer color (from primary color blue to white), but no solution is working for my project. I have tried to develop demo project, where the same code is working fine. This code is working fine for >=android 5.0 I do not know, which attribute is overridden by my value. I have two options to encounter this problem :- 1. find the attribute which is controlling that color value. 2. change color value by java code when page loads (in onViewCreated). Please

Edit Text hints not appearing on later version SDK

十年热恋 提交于 2019-12-08 14:26:17
问题 My app has been written for SDK 1.5 3.0 but when it is running on later versions the hints are not appearing in the EditText views. Any suggestions please? Cheers, Rick Here is the xml layout code: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scrollView1" android:layout_width="fill_parent" android:layout_height="wrap_content" > <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"