android-edittext

Soft keyboard doesn't appear

廉价感情. 提交于 2019-12-30 20:06:11
问题 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

Programmatically scrolling an EditText

浪子不回头ぞ 提交于 2019-12-30 18:55:33
问题 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

Programmatically scrolling an EditText

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-30 18:55:12
问题 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

Display Keyboard for EditText in Emulator (GenyMotion) Android 4.3

半腔热情 提交于 2019-12-30 16:23:06
问题 Does anybody know how to display the keyboard in the emulator when the EditText field has focus. I have tried so many solutions but none of them work. I am working in android 4.3 Jelly Bean. The Emulator I am using is GenyMotion. I would also like to know how to hide the keyboard when the EditText field loses focus. I assume however if the keyboard does not appear in the emulator it won't appear when testing on the device. Any help much appreciated 回答1: Just check the details of your emulator

Why does android ImageSpan show my picture twice (when setBounds exceed certain magic width)?

孤街醉人 提交于 2019-12-30 14:45:14
问题 Here is my code to put an ImageSpan in an EditText. public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); EditText et = (EditText) getActivity().findViewById(R.id.html_text); SpannableString ss = new SpannableString("ABC"); Drawable d = getResources().getDrawable(R.drawable.ic_launcher); d.setBounds(0,0,2256,760); ImageSpan span = new ImageSpan(d, "haha", ImageSpan.ALIGN_BASELINE); ss.setSpan(span, 0, 3, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); et

Android: Setting EditText Max Chars per Line?

醉酒当歌 提交于 2019-12-30 11:25:13
问题 Is there any way to set a maximum of Chars to a line in an EditText Field? I tried it with a TextWatcher , But I cant really do what I want. I would like to set a maximum of lines and a maximum of chars per line. Example: Inserted Text: Lorem ipsum dolor sit amet consetetur sadipscing elitr. Result (Max-Lines: 10, Max-Chars per line: 20): Lorem ipsum dolor sit amet consetetur sadipscing elitr. EDIT XML: <EditText android:id="@+id/edittext" android:layout_width="wrap_content" android:layout

EditText values in a RecyclerView gives same value after 5th position

浪子不回头ぞ 提交于 2019-12-30 11:04:58
问题 I have a RecyclerView and each row has a EditText also. I am adding item to RecyclerView by searching them and then I type the quantity in the edit text. Then I send it to the server to store using json format. Item add is working perfectly. There is no edit text value swapping problem also when scrolling. I can display 5 rows in the screen. Problem is when I send item to the server, edit text values in bottom rows get the same after 5th row. These are the rows I am adding to the recyclerview

EditText values in a RecyclerView gives same value after 5th position

不想你离开。 提交于 2019-12-30 11:03:16
问题 I have a RecyclerView and each row has a EditText also. I am adding item to RecyclerView by searching them and then I type the quantity in the edit text. Then I send it to the server to store using json format. Item add is working perfectly. There is no edit text value swapping problem also when scrolling. I can display 5 rows in the screen. Problem is when I send item to the server, edit text values in bottom rows get the same after 5th row. These are the rows I am adding to the recyclerview

focus on second edittext only if first is non-empty android

家住魔仙堡 提交于 2019-12-30 09:51:12
问题 Currently I have two edit-text,suppose I want to make validation for empty edittext check.What is better way for runtime validation. My code is; final EditText ev1 = (EditText) findViewById(R.id.editText1); final EditText ev2 = (EditText) findViewById(R.id.editText2); ev1.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View rv, boolean hasFocus) { if(!hasFocus && ev1.getText().length()==0) { ev1.requestFocus(); ev2.clearFocus(); } } }); In this

How come the Android soft keyboard is not responding to EditText?

你。 提交于 2019-12-30 09:23:42
问题 I have a SherlockFragmentActivity and a SherlockFragment that is within a TabManager. In this Fragment I have RadioButtons, CheckBoxes, a Button and an EditText in a LinearLayout. The keyboard sometimes does not respond when pressing on the EditText. In a 2.1 AVD the keyboard responds inconsistently, in a 4.0 AVD the keyboard does not respond at all, and on a device the keyboard responds inconsistently. Sometimes pressing the other objects then activates the ability to show the keyboard. Here