Questions tagged [edittextpreference]

120 questions
17
votes
5 answers

Android support EditTextPreference input type

Is there any way to specify the input method type for android.support.v7.preference.EditTextPreference?
ivkil
  • 414
  • 1
  • 4
  • 11
13
votes
3 answers

Android how to set default value of EditTextPreference from SharedPreference?

This time in the same project I'm facing a slightly challenging issue where in settings.xml file in the res/xml folder:
12
votes
3 answers

How do I programmatically add EditTextPreferences to my PreferenceFragment?

I am new to Android, so I need a little guidance on how to programmatically add EditTextPreference objects to my PreferenceFragment. I am pulling in a list of values from a web service. I have saved them successfully to my SharedPreferences, and I…
codingjeremy
  • 5,215
  • 1
  • 36
  • 39
10
votes
5 answers

How can we use android:inputType in EditTextPreference?

I checked the documentation of EditTextPreference http://developer.android.com/reference/android/preference/EditTextPreference.html But I failed to found the android:inputType attribute there. Then how it can be used in this code…
Nitish Chopra
  • 273
  • 1
  • 4
  • 11
10
votes
1 answer

Android EditText preference validation

I am using Edittextpreference as one of the preference in settings section. I want to validate this edittextpreference when the user enters data to it and clicks ok; before saving it in sharedpreference. I am trying to do something like this but…
learner
  • 1,095
  • 2
  • 18
  • 41
9
votes
4 answers

How to enable / disable a Preference?

I want to make my EditTextPreference not editable (as in, nothing happens when you click on the item in the Settings page). How do I do that? Here is my code:
Ankit Goyal
  • 437
  • 1
  • 7
  • 24
9
votes
4 answers

Validating EditTextPreference on Android

I have read the many answers on this question but my question is asking where I place the code. I am looking to validate that a number is greater than 100 in the EditTextPreference. This is the code I use to populate the preferences: public class…
Natalie Carr
  • 3,707
  • 3
  • 34
  • 68
7
votes
2 answers

EditTextPreference causes Inflate Exception

After about 1h looking for solutions to my problem in related topics, I decided to expose my case. Here it is: I'm having an InflateException everytime I try to open my PreferenceActivity. Log E/AndroidRuntime: FATAL EXCEPTION: main …
6
votes
0 answers

Android - EditTextPreference does not close keyboard once dialog dismissed

I'm building a settings screen using PreferenceFragment within PreferenceActivity. Everything works fine other than an annoying issue where the soft keyboard stays visible after an EditTextPreference dialog has been closed, either by tapping…
6
votes
4 answers

Android EditTextPreference style

In my app in setings I use EditTextPreference , and on android API uder 11 edittext field has black background and black text color. How can I chenge EditTextPreferences background color ? I tried: in theme :
5
votes
3 answers

How to set maximal length of EditTextPreference of AndroidX Library?

Recently, I migrate my android project to AndroidX and I use the EditTextPreference from AndroidX library. Now, I want to set the maximum length of the EditTextPreference to let say 50. I have tried to use: android:maxLength="50" but it's not…
5
votes
3 answers

How to set null validation in edittextpreference dialog

How to set null validation in edittextpreference dialog so that if it is null, the user should not be able to click ok and some message should be displayed in the dialog itself. I have been trying to find it for a long time but no success....
5
votes
1 answer

Custom EditTextPreference

I want to customize my EditTextPreference, so i added a TextView in the left of my EditTextPreference. Here is my code:
haythem souissi
  • 3,263
  • 7
  • 50
  • 77
5
votes
4 answers

Any simple way to require an EditTextPreference value to not be blank in Android?

I have a number of EditTextPreference which must be a number 0-9. I can prevent other characters but not backspace. Backspace + Okay = an empty value. An empty value means when the it is retrieved and parsed into a number it will crash. At the…
Ael
  • 323
  • 4
  • 14
4
votes
3 answers

Why I can't enforce EditTextPreference to take just numbers?

GOAL: Use EditTextPreference to take a number input from an user. PROBLEM: I'm using support.v7.preference and, from what I've understood, this library bring problems to creates a custom DialogPreference (HowTo use support.v7.preference with…
Maicake
  • 1,046
  • 10
  • 34
1
2 3 4 5 6 7 8