android-edittext

Android: softkeyboard not showing up

烈酒焚心 提交于 2019-12-01 18:31:50
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 mInputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);

EditText Performance: Understanding GPU Process Time on Profile GPU Rendering

左心房为你撑大大i 提交于 2019-12-01 18:08:58
问题 I am investigating ways to improve performance in EditText , specifically in regards to load times. When loading large documents of a few thousand words or more, calling setText can freeze the UI for several seconds on some of my test devices and emulators. In response, I have explored several possible solutions, none of which produce satisfactory results. I have tried to split large documents by paragraph, and load each paragraph into its own RecyclerView or ListView row. RecyclerView was

Android emulator : insert negative number?

三世轮回 提交于 2019-12-01 18:07:41
I suppose it must be easy but how do I insert a negative number in an EditText ? I am running the emulator on a Mac. Thank you. Just press '-' before you enter the number? If that's not possible, there is probably something wrong with the inputType of the editText. For example, android:inputType="numberDecimal" doesn't allow negative numbers. In that case you should add: android:inputType="numberDecimal|numberSigned" . In resource file .axml, EditBox change type android:inputType="numberDecimal" to android:inputType="numberDecimal|numberSigned" It works for me EditText yourEditText = (EditText

Soft keyboard doesn't appear

て烟熏妆下的殇ゞ 提交于 2019-12-01 18:00:36
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:maxLines="10" android:minHeight="140dp" android:hint="@string/message" /> <requestFocus /> fllo Add a

EditText input method action not working when setting imeActionLabel

拟墨画扇 提交于 2019-12-01 17:44:57
问题 I have an Edittext with imeoptions as actiongo . and I triggered my event when pressing soft keyboard enter button. mModelId.setOnEditorActionListener(new OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { boolean handled = false; // if (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) { if (actionId == EditorInfo.IME_ACTION_GO) { id = mModelId.getText().toString(); System.out.println("Model id in Edittext:-"+ id); Toast.makeText

Android How to get selected word in Edittext?

此生再无相见时 提交于 2019-12-01 17:32:59
I am developing an app like Notepad in which I want to change the selected text formatting dynamically (colors, changing font styles, bold, italic, underline etc.) How can I format a specific word? Imran Rana You can get the selected word using getSelectionStart() and getSelectionEnd() method : EditText etx=(EditText)findViewById(R.id.editext); int startSelection=etx.getSelectionStart(); int endSelection=etx.getSelectionEnd(); String selectedText = etx.getText().substring(startSelection, endSelection); Then you can apply your specific formatting by using this selected substring in the full

How do I trigger an action when the user has hit enter?

僤鯓⒐⒋嵵緔 提交于 2019-12-01 16:58:14
If (in Android) I have an EditText box, how can I trigger an event when the user has finished entering data and hits return/Next? I have tried using the code below but it seems to have no effect. I also get an 'The method onEditorAction(EditText, int, KeyEvent) from the type new extView.OnEditorActionListener(){} is never used locally' error. myEditText.setOnEditorActionListener(new EditText.OnEditorActionListener() { public boolean onEditorAction(EditText v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_NEXT) { Entropy1024 I played around a bit with various things and

Hint Alignment to the right of password EditText

戏子无情 提交于 2019-12-01 16:56:02
I'm working on and activity with arabic language. I want the hint of the username and password to start from the right and I have no problem f typing started from the left but in my UI I want the hint to be of the right side. But when I'm adding the inputType for the EditText the hint moves to the left.I tried solving it programmatically but it didn't work. Java EditText password = (EditText) findViewById(R.id.input_password); password.setTypeface(Typeface.DEFAULT); XML <EditText android:id="@+id/input_password" android:layout_width="match_parent" android:layout_height="match_parent" android

How do I trigger an action when the user has hit enter?

倾然丶 夕夏残阳落幕 提交于 2019-12-01 15:46:00
问题 If (in Android) I have an EditText box, how can I trigger an event when the user has finished entering data and hits return/Next? I have tried using the code below but it seems to have no effect. I also get an 'The method onEditorAction(EditText, int, KeyEvent) from the type new extView.OnEditorActionListener(){} is never used locally' error. myEditText.setOnEditorActionListener(new EditText.OnEditorActionListener() { public boolean onEditorAction(EditText v, int actionId, KeyEvent event) {

Display Keyboard for EditText in Emulator (GenyMotion) Android 4.3

若如初见. 提交于 2019-12-01 15:45:45
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 Just check the details of your emulator. Soft Keyboard won't be displayed if you have checked the option "Hardware Keyboard Present", uncheck that