android-edittext

EditText not capturing ViewFlipper flings?

試著忘記壹切 提交于 2020-01-11 06:21:12
问题 This is maddening. I have the following XML layout: <FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/shadow" android:focusable="true" android:focusableInTouchMode="true"> <ViewFlipper android:id="@+id/flipper" android:layout_width="fill_parent" android:layout_height="fill_parent"> <EditText android:id="@+id/reviews" style="@style/DescriptionArea" android:layout_width="fill_parent" android:layout_height="wrap_content" android

Android EditText - Delete the last letter with a button

谁都会走 提交于 2020-01-11 05:46:07
问题 I have to buttons that writes A and B to an edittext. If there is something in the edittext how can I delete the last letters with the "Del" button? My layout: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" > <Button android:id="@+id/buttonb" android:layout_width="100dp" android:layout_height="100dp" android:layout

How to delete the last letter from EditText with button? [duplicate]

旧巷老猫 提交于 2020-01-11 02:08:09
问题 This question already has answers here : Android EditText - Delete the last letter with a button (4 answers) Closed 5 years ago . I have to buttons that writes A and B to an edittext. If there is something in the edittext how can I delete the last letters with the "Del" button ? My layout: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools

Android : clear focus on edittext when activity starts

跟風遠走 提交于 2020-01-10 19:32:11
问题 I've some settings page in my app. Once the activity gets starts directly it focus to edittext and i used following code to clear foucs. <RelativeLayout android:id="@+id/RequestFocusLayout" android:focusable="true" android:focusableInTouchMode="true" android:layout_width="0px" android:layout_height="0px"/> and in java code RelativeLayout focuslayout = (RelativeLayout) findViewById(R.id.RequestFocusLayout); focuslayout.requestFocus(); The above code is working fine when activity starts at

Disable auto focus on edit text

元气小坏坏 提交于 2020-01-10 06:46:55
问题 I have an edit text: <LinearLayout android:id="@+id/linearLayout7" android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_weight="1" android:id="@+id/editText1" android:text="3"> <requestFocus></requestFocus> </EditText> <Button android:text="Button" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/button2"></Button> </LinearLayout> and

EditText in GridView : How to get value from Multiple EditText

耗尽温柔 提交于 2020-01-09 23:55:24
问题 I have created GridView using following XML code: grid_layout.xml <GridView android:id="@+id/productList" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_margin="5dp" android:layout_marginBottom="10dp" android:drawSelectorOnTop="true" android:fastScrollEnabled="true" android:horizontalSpacing="10dp" android:listSelector="@drawable/list_view_selector" android:numColumns="3" android:stretchMode="columnWidth" android:verticalSpacing="10dp" > </GridView> <!--

Can we have uneditable text in edittext

感情迁移 提交于 2020-01-09 06:49:48
问题 I am using an EditText . Is it possible to have a part of text uneditable and the rest editable in the same EditText ? 回答1: You could use editText.setFocusable(false); or editText.setEnabled(false); although disabling the EditText does currently not ignore input from the on-screen keyboard (I think that's a bug). Depending on the application it might be better to use an InputFilter that rejects all changes: editText.setFilters(new InputFilter[] { new InputFilter() { public CharSequence filter

Can we have uneditable text in edittext

核能气质少年 提交于 2020-01-09 06:49:46
问题 I am using an EditText . Is it possible to have a part of text uneditable and the rest editable in the same EditText ? 回答1: You could use editText.setFocusable(false); or editText.setEnabled(false); although disabling the EditText does currently not ignore input from the on-screen keyboard (I think that's a bug). Depending on the application it might be better to use an InputFilter that rejects all changes: editText.setFilters(new InputFilter[] { new InputFilter() { public CharSequence filter

Android: Disable soft keyboard at all EditTexts

浪子不回头ぞ 提交于 2020-01-08 17:15:52
问题 I am working on a dialog at Android with a few EditText s. I've put this line at the onCreate() in order to disable the soft keyboard: Keypad.this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); The problem is that it works only when the dialog appear and doing nothing. When I move to the next EditText , the keyboard appears and not going down. Does anybody have an idea how to solve this issue? 回答1: create your own class that extends EditText and

Average from EditTexts

匆匆过客 提交于 2020-01-07 09:01:29
问题 In my activity, there are two buttons: one for adding an item to a ListView, which is formed by an EditText (where the user enters a decimal number) and another one, which will start the calculation. The goal is to calculate the average of the numbers entered in the EditTexts, depending on the number of items added to the ListView. I have the following code, and I think I might get the number of childs created and then divide the adding by the childs, but I have read a lot of similar examples