android-edittext

Android: softkeyboard not showing up

被刻印的时光 ゝ 提交于 2019-12-01 21:06:27
问题 I have 2 EditTexts in the MainActivity Layout. If i run the application normally the 1st EditText gets focused but the softkeyboard is not openned. but when i used this: public class TestingActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); EditText et1 = (EditText) findViewById(R.id.editText1); EditText et2 = (EditText) findViewById(R.id.editText2); et2.requestFocus(); InputMethodManager

Android EditText's container (RecyclerView) auto scroll when EditText is Focused

♀尐吖头ヾ 提交于 2019-12-01 21:02:22
I got a RecyclerView whose element contains a EditText widget. 1.currently focusing on the second EditText,the first EditText is partly showed on the screen. the first EditText is partly showed 2.when click the first EditText, it got focus, then RecyclerView would automatically scroll down to fully show the first EditText. RecyclerView automatically scroll down when first EditText got focused This is great,but what I want is RecyclerView should not automatically scroll. Any solution? thanks! Actually, there is a scroll state of RecycleView that you can control like this; Create your own

Edittext inputtype constant value doesnot match

时光怂恿深爱的人放手 提交于 2019-12-01 20:57:30
问题 In android xml file im using editext as <EditText android:id="@+id/email" android:layout_width="fill_parent" android:layout_height="33dp" android:inputType="textEmailAddress" android:hint="Enter your mail id" /> In java file while validating that editext. if(editextobj.getInputType()==InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS){ } or if(getInputType()==(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS)){ } this condition is not working since editextobj.getInputType()

Android : Display an EditText in a menu

梦想与她 提交于 2019-12-01 20:57:09
问题 I'm currently working on a mp3 library for Android. Thing is, I want the user to pick up the name of the playlist he would like to add (useful innit ?). Therefore, I created a context menu on the playlists list which allows the user to choose between 3 options, create, delete, rename. Why I'm trying to do is to display an EditText field if the user clicks on "create", so that he can write the new playlist's name. However, I can't manage to display it. Here are the listeners I made for the

Set a consistent theme for all the editTexts in Android

佐手、 提交于 2019-12-01 20:51:28
I have finished making my app. Now, I want to reset all my editTexts to have the layout width as fill parent instead of wrap content. android:layout_width="fill_parent" while currently all my editTexts are android:layout_width="wrap_content" Is there any way i can do this in a style xml file, instead of individually in each layout? I currently have this as my styles.xml <style name="AppTheme" parent="android:Theme.Light"> <item name="android:fontFamily">Verdana</item> <item name="android:editTextStyle">@style/EditTextStyle</item> </style> <style name="EditTextStyle" parent="@android:style

Cannot click on EditText after adding it to WindowManager

谁说我不能喝 提交于 2019-12-01 20:12:23
I am creating a layout pretty much dynamically. What I am doing is, creating an EditText, adding it to a RelativeLayout object and putting it to UI through WindowManager. How do I get the edittext to be able to type after I do this? Here is a jist of my code RelativeLayout layout = new RelativeLayout(this); private EditText response = new EditText(this); **Set width/height/extra** layout.addView(response, params); //Params are set properly WindowManager myWindow = (WindowManager) getSystemService(WINDOW_SERVICE); myWindow.addView(layout, params_window); EDIT: I am trying to achieve a popup

EditText addTextChangedListener only for user input

十年热恋 提交于 2019-12-01 20:05:01
问题 I have an EditText where I listen for changes in text: editText.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) {} @Override public void onTextChanged(CharSequence s, int start, int before, int count) {} @Override public void afterTextChanged(Editable s) { // do stuff } }); This works fine so far, if I type something in the EditText, things in afterTextChanged() are executed. Now, in the same activity I have a

How to add text to editext

ぐ巨炮叔叔 提交于 2019-12-01 19:43:09
I've got a problem with populating an edittext. Using the following code i can set the text just fine, however what i am trying to do is add to the edittext. For example the following code displays a "1" in my edittext but if I press it again it just replaces the "1" with "1" and so on. What i need is it to display "1111" if I press it four times. heres my code: @Override public void onClick(View v) { switch (v.getId()) { case R.id.button1: Button txtnum = (Button) findViewById(R.id.button1); Bundle bundle = new Bundle(); bundle.putString("number1", txtnum.getText().toString()); String title =

Edittext Fonts Are Not Displaying

元气小坏坏 提交于 2019-12-01 18:56:02
I'm going through a weird problem. I have created CustomEdittext class for setting Typeface for whole application and it works successfully in nearly all cases. I am using circo.ttf The problem is that when I set android:inputType="textPassword" , text stops displaying after typing, maybe because the font doesn't have a password symbol or maybe there is some other problem. Below is an example of my issue : CustomEdittext.java public class CustomEdittext extends EditText { public CustomEdittext(Context context) { super(context); changeFonts(context); } public CustomEdittext(Context context,

Programmatically scrolling an EditText

↘锁芯ラ 提交于 2019-12-01 18:54:10
I'm writing a simple caesar-encryption-activity. Two EditTexts on screen, one clear-text, one crypted. Here's an example for the crypted EditText - the cleartext one is similar. <EditText android:layout_below="@id/Caesar_Label_CryptText" android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/Caesar_Text_CryptText" android:hint="Enter crypted text" android:maxLines="2" android:lines="2" android:minLines="2" android:inputType="text|textMultiLine|textVisiblePassword" android:scrollbars="vertical" android:gravity="top" /> Now when entering cleartext I have an