android-edittext

Android disable space only for Edittext

限于喜欢 提交于 2019-12-31 17:57:28
问题 In my android application I need to disABLE Spacebar only. But I didn't find a solution for this problem. I need to disable space bar and when user enter space should not work, special characters, letters, digits and all other should work. What I tried is, etPass.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { // TODO Auto-generated method stub String str = s.toString(); if(str.length() > 0 && str.contains(" ")

Android disable space only for Edittext

拜拜、爱过 提交于 2019-12-31 17:57:20
问题 In my android application I need to disABLE Spacebar only. But I didn't find a solution for this problem. I need to disable space bar and when user enter space should not work, special characters, letters, digits and all other should work. What I tried is, etPass.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { // TODO Auto-generated method stub String str = s.toString(); if(str.length() > 0 && str.contains(" ")

EditText with textPassword inputType, but without Softkeyboard

早过忘川 提交于 2019-12-31 07:08:08
问题 i wanted to create an EditText with an android:inputType="textPassword. However i also do not want to use the SoftKeyboard for input. So i tried setting InputMethod to null, but this would also disable the textPassword features of replacing password rendering to " * [lastchar]". Is there any other way to disable the softKeyboard from showing up? 回答1: Uhm just figured it out myself: Simply use: pinInput.setOnClickListener(new OnClickListener() { public void onClick(View v) { InputMethodManager

Called From Wrong Thread Exception

*爱你&永不变心* 提交于 2019-12-31 05:14:13
问题 I am getting an exception here when I try to bring another view to the front. It happens in the last method of my BoardView class where it says if(lives == 0). Can anybody see where I should be calling this bringToFront method from?? public class BoardView extends SurfaceView implements SurfaceHolder.Callback{ Context mContext; // thread initialization private BoardThread thread; Thread timer; // box variables Bitmap box = (BitmapFactory.decodeResource (getResources(), R.drawable.box));

remove additional underline in EditText

左心房为你撑大大i 提交于 2019-12-31 02:34:47
问题 I have EditText with custom background drawable: EditText code: <EditText android:id="@+id/etName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@{ViewModel.isAllowEdit ? @drawable/profile_et_background_active : @drawable/profile_et_background}" android:inputType="@{ViewModel.isAllowEdit ? InputType.TYPE_CLASS_TEXT : InputType.TYPE_NULL}" android:text="@={ViewModel.name}" android:textColor="@color/main_dark_text_color" /> I'm using android

InputType of EditText in Android

邮差的信 提交于 2019-12-31 02:33:07
问题 I would like to have following: - number keyboard should be displayed first - but it should be possible to change to text keyboard and to type some letters. I've asked almost the same question and accepted an answer. InputType of EditText in Android But now I found some strange behaviour, setting InputType to Number : it is possible to change keyboard to text type, but it's impossible to type some text. Any Ideas, why does it happen_ Does anybody know how to use TYPE_MASK_CLASS as input type?

EditText Hint doesn't appear in Arabic on Galaxy note 1 with Android ICS

折月煮酒 提交于 2019-12-31 01:58:05
问题 I have an arabic hint in which I want to set in EditText that I am using in Dialog... it worked fine for many devices except Galaxy note 1 which has Android ICS. Note 1 - I converted the language of phone to Arabic so it showed the Arabic hint. 2 - EditText on Activity screens worked fine but on a Dialog it doesn't show the hint in Arabic. The XML EditText in layout is: <EditText android:id="@+id/editText1" android:layout_width="match_parent" android:layout_height="wrap_content" android

Null Pointer Exception - Getting EditText Value

蓝咒 提交于 2019-12-31 01:48:29
问题 This is my first question on here I will apologize in advance if I didn't ask this question very well. I have looked at my other questions similar to my problem, but I have not found a good solution to satisfy what is going on in my program. So my problem is I am trying to assign a value to a variable called, num1 from my EditText field called, num1TextField , but I am not having any luck so far. The segment inside my java file that throws the exception is: EditText num1Field = (EditText)v

Unwilling EditText onTouchListener Function Call [duplicate]

纵然是瞬间 提交于 2019-12-31 00:41:25
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: public boolean onKey() called twice? I have an EditText field which calls a popUp view with radio buttons. PopUp and RadioGroup implementation works nice. But I just realize when pressed or Touch to EditText, onTouchListener is called 2 times. I also just realize that the reason of my previous question is the same issue. Here is the the EditText; etOdemeSekli = (EditText)findViewById(R.id.etOdemeSekli);

Soft keyboard doesn't appear

人走茶凉 提交于 2019-12-30 20:07:03
问题 I'm testing my app on android 4.0.4 Samsung galaxy duos, the problem is if I set: android:textIsSelectable="true" the keyboard doesn't appear, though it appears on the emulator. Any suggestions? Here is how my EditBox looks like <EditText android:focusable="true" android:layout_width="fill_parent" android:layout_height="wrap_content" android:inputType="textVisiblePassword|textCapWords|textMultiLine" android:textIsSelectable="true" android:gravity="top|left" android:minLines="6" android