android-edittext

Get text from dynamically created EditText on click of a button

安稳与你 提交于 2019-12-23 03:45:15
问题 I am creating a dynamic layout in which I have 2 EditText and one Button. On click of a button a new same king of layout is created. I want , when I click on the button I should be able to get data from edittexts and store them and then add new layout.I am not able to get data from edittext , it is coming up blank. Below is my code . I am also adding screenshot of my layout @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R

NestedScrollView is not scrolling due to Editext

你。 提交于 2019-12-23 03:31:45
问题 I am facing issue when i have following Structure in NestedScrollView . Here is my xml file : <android.support.v4.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/app_base_color" app:layout_behavior="@string/appbar_scrolling_view_behavior" android:id="@+id/nested_view_editprofile" android:focusable="true" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation=

EditText with InputFilter assigned / Decimal separator hidden in landscape mode

删除回忆录丶 提交于 2019-12-23 03:25:00
问题 I'm facing a very strange problem with an EditText with assigned InputFilter in an application I'm writing. The idea is, to have an EditText, which only accepts decimal numbers as input with a maximum of two decimal places and a decimal separator according to the user's locale settings. Here are the relevant pieces of code The EditText in my layout <EditText android:id="@+id/value" android:layout_width="match_parent" android:layout_height="wrap_content" android:digits="01234567890,." android

multiple cursor shown in Edittext

耗尽温柔 提交于 2019-12-23 03:14:37
问题 i am facing a weird problem. In my EditText: 1) I can see multiple cursor when user type anything. 2) Hint is also visible even when user is typing something. Kindly refer to the screenshot Following is layout XML: <RelativeLayout android:id="@+id/relativeLayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerVertical="true" > <AutoCompleteTextView android:id="@+id/actvCountry" style="@style/autoCompleteTextTheme" android:layout_width="match

multiple cursor shown in Edittext

孤街浪徒 提交于 2019-12-23 03:14:18
问题 i am facing a weird problem. In my EditText: 1) I can see multiple cursor when user type anything. 2) Hint is also visible even when user is typing something. Kindly refer to the screenshot Following is layout XML: <RelativeLayout android:id="@+id/relativeLayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerVertical="true" > <AutoCompleteTextView android:id="@+id/actvCountry" style="@style/autoCompleteTextTheme" android:layout_width="match

How to Set Id in EditText programmatically in Android

。_饼干妹妹 提交于 2019-12-23 01:26:08
问题 I have this button on GridLayout called addnewTask. When you create this button, it will create an EditText. private GridLayout gridLayout; int rowIndex = 3; int colIndex = 1; int i=0; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_set_task); gridLayout = (GridLayout) findViewById(R.id.taskLayout); } This function to create EditText when the button is clicked --> public void addView(View view) { i++; String tname =

How to set color of selection in EditText in my custom theme? (android)

a 夏天 提交于 2019-12-23 01:12:34
问题 I created my custom theme and in my layouts I have a couple of EditText views. Since I set android:selectAllOnFocus="true" ,I've noticed that the color of selection is default one for my phone, so I was wondering can I set some attribute and which, of course, in my definition of my theme to have a desired effect, i.e. set the color of selection to needed color? Best, Deveti 回答1: Set android:textColorHighlight to your preferred color. 来源: https://stackoverflow.com/questions/28466172/how-to-set

How to set color of selection in EditText in my custom theme? (android)

瘦欲@ 提交于 2019-12-23 01:12:17
问题 I created my custom theme and in my layouts I have a couple of EditText views. Since I set android:selectAllOnFocus="true" ,I've noticed that the color of selection is default one for my phone, so I was wondering can I set some attribute and which, of course, in my definition of my theme to have a desired effect, i.e. set the color of selection to needed color? Best, Deveti 回答1: Set android:textColorHighlight to your preferred color. 来源: https://stackoverflow.com/questions/28466172/how-to-set

Possible to open “Speak Now” dialog programmatically?

心已入冬 提交于 2019-12-22 18:48:12
问题 Is it possible to open the "Speak Now" dialog programmatically? Currently, if the user taps my 'Search' button, a dialog opens and I have the soft keyboard open automatically so the user doesn't need to tap the textedit field. I'd like to offer an alternate 'Search by voice' that will open the dialog and have the "Speak now" window open automatically. So the user doesn't have to find and tap the 'mic' button on the keyboard. Any ideas? 回答1: Yes, it is possible. Take a look at ApiDemos sample

setSpan() on EditText deletes other spans

帅比萌擦擦* 提交于 2019-12-22 14:47:26
问题 I have a bold button that, when pressed, is supposed to change the typeface of the selected text in the EditText field . This all works perfectly, with one exception. If there is bold typeface elsewhere in the EditText , and I try to create a new bold section, the original section is changed back to normal . For example, this string: Bold not bold more bold. If I highlight any of the normal words and press the button, they do become bold , but the first word becomes normal . I can't see any