android-edittext

android edittext minmum and maximum value

我们两清 提交于 2020-01-13 03:15:30
问题 I am in development of an android app.. actually i need to set a minimum and maximum value for an editext entry my minimum value is 18 and maximum is 65.I did the exact code of this package com.test; import android.text.InputFilter; import android.text.Spanned; public class InputFilterMinMax implements InputFilter { private int min, max; public InputFilterMinMax(int min, int max) { this.min = min; this.max = max; } public InputFilterMinMax(String min, String max) { this.min = Integer.parseInt

InputFilter on EditText cause repeating text

匆匆过客 提交于 2020-01-12 12:26:53
问题 I'm trying to implement an EditText that limits input to Capital chars only [A-Z0-9] with digits as well. I started with the InputFilter method from some post.But here I am getting one problem on Samsung Galaxy Tab 2 but not in emulator or Nexus 4. Problem is like this : When I type "A" the text shows as "A" its good Now when I type "B" so text should be "AB" but it gives me "AAB" this looks very Strange. In short it repeats chars Here's the code I'm working with this code : public class

Android EditText in AlertDialog seems too wide

风流意气都作罢 提交于 2020-01-12 06:51:05
问题 It seems like the EditText in the image below is too wide. I assume that I have misused the SDK in some way and until convinced otherwise I am not looking for a way to specify some number of margin/padding pixels on the sides of the EditText . This one looks more appropriate. Here's my code (that creates the first, 'Create Tag', dialog): final Dao<Tag, Integer> tagDao = getHelper().getTagDao(); final EditText input = new EditText(this); input.setSingleLine(true); input.setHint(R.string.create

EditTextPreference Disable Buttons?

六月ゝ 毕业季﹏ 提交于 2020-01-12 05:44:06
问题 I want to have an EditTextPreference that will disable the OK button if there is no text in the EditText field. I created a custom EditTextPreference class and I am able to get the EditText object and set a TextWatcher, but I can't find a way to disable the button. It looks like I just don't have access to the OK and Cancel buttons in the Dialog. Anyone know a way to get at these buttons or to do what I am trying to do? Only other option is to try to create from scratch a custom Dialog that

Warning on EditText

允我心安 提交于 2020-01-12 03:15:47
问题 I'm trying to define an EditText but this warning is shown: This text field does not specify an inputType or a hint. The code in main.xml is: <EditText android:id="@+id/input" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/textTest" /> How can I fix it? 回答1: You could add a hint : android:hint="This will appear to the user if he didn't enter something yet in the EditText" and a inputType so you could present to the user a better suited soft

Warning on EditText

自古美人都是妖i 提交于 2020-01-12 03:15:27
问题 I'm trying to define an EditText but this warning is shown: This text field does not specify an inputType or a hint. The code in main.xml is: <EditText android:id="@+id/input" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/textTest" /> How can I fix it? 回答1: You could add a hint : android:hint="This will appear to the user if he didn't enter something yet in the EditText" and a inputType so you could present to the user a better suited soft

Not able to fill details in EditText Of ListView in android

情到浓时终转凉″ 提交于 2020-01-11 14:08:33
问题 I had created an app with custom listview. My listview contains an edittext field. But I can't fill edit text with value.I am new to android so it is hard to find error to me. Here is my code: public class MainActivity extends Activity { private ListView myList; private MyAdapter myAdapter; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); myList = (ListView)

Not able to fill details in EditText Of ListView in android

帅比萌擦擦* 提交于 2020-01-11 14:08:03
问题 I had created an app with custom listview. My listview contains an edittext field. But I can't fill edit text with value.I am new to android so it is hard to find error to me. Here is my code: public class MainActivity extends Activity { private ListView myList; private MyAdapter myAdapter; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); myList = (ListView)

How to make modification Android Snackbar containing with LayoutInflater button and editText

霸气de小男生 提交于 2020-01-11 11:08:53
问题 My project now is how to make a Snackbar displayed at the bottom of the screen. The Snackbar contain with editText and three button for selection categories. I use LayoutInflater and follow these code for my script, and it's work. My problem now is, how to get response when user click the button ? Here my code @Override public void onClick(View v) { CoordinatorLayout linearLayout = (CoordinatorLayout)findViewById(R.id.coordinatorLayout); final Snackbar snackbar = Snackbar.make(linearLayout, "

Android emulator : insert negative number?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-11 08:31:14
问题 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. 回答1: 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" . 回答2: In resource file .axml, EditBox change type android:inputType=