android-edittext

Prevent android from saving and retrieving passwords when typing on EditText

自作多情 提交于 2019-12-24 02:55:12
问题 How can I prevent this from happening, multiple users are going to use the app on the same device and I do not want all of them having access to some places 回答1: You simply just add one property to your editText view android:inputType="textPassword|textNoSuggestions" and you are done. if it is not working for you there is another alternative solution. You can turn off autofill programmatically. You can try to this. public class BaseActivity extends AppCompatActivity { @Override public void

App crashing on clicking on EditText with latest updates (gradle 4.4 - android studio 3.1)

一个人想着一个人 提交于 2019-12-24 02:40:11
问题 I recently updated my android studio to version 3.1 and also my gradle to version 4.4. Since, then I have been facing this issue of app going into ANR when clicking on an EditText that should popup a soft input keyboard. On clicking on an EditText I see that there are multiple GCs that get triggered and eventually the app crashes with and ANR message saying that there is a stack overflow exceeding the size of 8 MB. Here is the crash that I see: http://crashes.to/s/77a48e5d43c. Also pasting it

Specifying virtual keyboard type for EditText in XML

 ̄綄美尐妖づ 提交于 2019-12-24 02:13:17
问题 I'm creating a ListActivity. In each list item I have a View I've created which contains a RatingBar and an EditText. In the screenshot at the bottom, you can see the virtual keyboard contains a returnline key and no "Done" key. I would like to specify a different style of keyboard to use (and hopefully retain the spell checking bar). I would like my virtual keyboard to have a "Done" key instead of a return key. Can I set the style of virtual keyboard I'm wanting in the EditText's XML? If so,

Mixing Android widget old & new themes

旧时模样 提交于 2019-12-24 02:02:10
问题 I'm starting my second Android app and find that I would like to mostly use HOLO dark theme for app. EXCEPT for the EditTexts, I would prefer to use the old Gingerbread style ones (looking closer to iOS) with some rounded corner. I'm a bit lost as to how I can achieve this. If anyone could drop some hints or links that would be HIGHLY appreciated 回答1: In your Theme: <style name="myTheme" parent="android:Theme.Holo"> <item name="editTextStyle">@style/MyWidget.EditText</item> </style> <style

Mixing Android widget old & new themes

烈酒焚心 提交于 2019-12-24 02:01:08
问题 I'm starting my second Android app and find that I would like to mostly use HOLO dark theme for app. EXCEPT for the EditTexts, I would prefer to use the old Gingerbread style ones (looking closer to iOS) with some rounded corner. I'm a bit lost as to how I can achieve this. If anyone could drop some hints or links that would be HIGHLY appreciated 回答1: In your Theme: <style name="myTheme" parent="android:Theme.Holo"> <item name="editTextStyle">@style/MyWidget.EditText</item> </style> <style

get the value of dynamically generated multiple edittext using gettext in android

吃可爱长大的小学妹 提交于 2019-12-24 01:47:06
问题 i want the text value set on multiple edittext, onclick of button .Edit text is generated dynamically and i want value of each particular edit text.and store that value of text in a string array. here is the code. if (type.equalsIgnoreCase("Edittext")) { Question = cursor1.getString(cursor1 .getColumnIndex(AndroidOpenDbHelper.QUESTIONS)); String ID = cursor1.getString(cursor1 .getColumnIndex(AndroidOpenDbHelper.ID)); // ll_layout1 = (LinearLayout) // findViewById(R.id.linearlayout1); tv

How to have fixed cursor position for EditText?

偶尔善良 提交于 2019-12-24 01:37:34
问题 I don't want the user to insert anything in the middle of the EditText box. I only want to allow the user to click on the EditText box to bring out the keyboard, and insert at the end of the EditText box. Is there a way to disable the ability for the user to change the cursor position when clicking on the EditText box? I don't mind if the answer if done in XML or Java. Thank you :) Edit: if I have to use setSelection, is there a way to detect when the EditText box is clicked? so that I can

Changing the input source of form fields in webview

白昼怎懂夜的黑 提交于 2019-12-24 01:25:26
问题 Is there any way that I can change the input source of text fields of the webpages in webview? Instead of the popping up the android keyboard, i want to give the input of my own displayed keyboard to fields in Webview. 来源: https://stackoverflow.com/questions/35465569/changing-the-input-source-of-form-fields-in-webview

Android Edittext: Get LineCount in an Activity's onCreate()

痴心易碎 提交于 2019-12-24 01:25:17
问题 How can I do getLineCount() of an Edittext in the onCreate() method of an activity, having changed the Edittext's text, like the following: @override public void onCreate(Bundle savedInstanceState){ myEditText.setText("EXAMPLE"); myEditText.getLineCount(); } Because the view has not been drawn yet getLineCount() will always return 0. Is there a way to get around this problem? Thanks! 回答1: Ugh, it's a problem with UI everywhere. You can use a Handler. You'll post a Runnable that will get the

Android Arabic Cursor Split

爷,独闯天下 提交于 2019-12-24 01:01:45
问题 I'm using a custom EditText because client wants to force arabic locale globally in the app. Here is the code I use in the constructor of the EditText: setTextDirection(TEXT_DIRECTION_LOCALE); It works perfectly, but I have a strange behavior of the cursor as you can see in the image Somebody knows if it's normal or how can I solve this? Thank you 回答1: Found the solution there: https://ux.stackexchange.com/a/39639 Apparently, it's the normal behavior when you have rtl and ltr text mixed. 回答2: