Questions tagged [preferenceactivity]

PreferenceActivity in Android is a base class for an activity to show a hierarchy of preferences to the user

680 questions
11
votes
3 answers

What is the name of SharedPreferences file name?

I am new to Android and I am kind of stuck for 6 hours straight. The problem is I don't know the name of the preferences file, and I need to get values from preferences file. I am using Android Studio and created a "Settings Activity". All the way I…
Abbas
  • 3,529
  • 5
  • 36
  • 64
11
votes
2 answers

Android Back Button Doesn't Return to Previous Activity

I have an app that has two activities: MainActivity and SettingsActivity. The MainActivity has a menu with a single Settings menu item. When this menu item is clicked, it launches the SettingsActivity with an intent. After the activity starts up, I…
Dan Taylor
  • 143
  • 1
  • 2
  • 7
10
votes
5 answers

ActivityNotFoundException (YES, this activity is declared in AndroidManifest.xml)

I found a few threads reporting a similar problem but none of them really offers something that I haven't tried already. An innocent such call: mActivity.startActivity(new Intent(mActivity, MyEditPreferences.class)); with the following in…
an00b
  • 11,338
  • 13
  • 64
  • 101
10
votes
3 answers

Android. CheckBoxPreference color

How can I change the checkbox color of CheckBoxPreference? I specifying theme attribute does not work. I have also set theme in manifest, but it is not displayed with accent color but with default color instead. Manifest:
void
  • 731
  • 2
  • 11
  • 26
10
votes
3 answers

ActionBar in PreferenceFragment not recalculating height and font size

Using the latest AppCompat-v21 library, I used ActionBarActivity to create and populate the PreferenceFragment. However, the ActionBar does not seem to change height and the text size when the orientation or screen size is altered. Testing this on…
10
votes
4 answers

Why does Kit Kat require the use of the isValidFragment?

Ever since KitKat was released, I've noticed a whole bunch of my apps updating with "Fixing a crash in Kit Kat". Recently when I released my own app, I figured out the likely source of that is the new "isValidFragment" requirement for using…
PearsonArtPhoto
  • 38,970
  • 17
  • 111
  • 142
10
votes
2 answers

PreferenceActivity actionbar home icon won't return home (unlike ET :)

My PreferenceActivity works great except for one thing. The ActionBar icon, which perfectly returns the user to the previous activity in all my other activities doesn't work in the PreferenceActivity. When I click the icon it flashes as if it was…
PeteH
  • 1,870
  • 25
  • 23
10
votes
4 answers

set custom font for text in PreferenceScreen

My PreferenceActivity looks like: import android.os.Build; import android.os.Bundle; import android.preference.PreferenceActivity; import android.preference.PreferenceFragment; import android.widget.TextView; public class Settings extends…
Sever
  • 2,338
  • 5
  • 35
  • 55
9
votes
2 answers

Reload Preferences in PreferenceActivity on Resume

In my app, some settings can possibly be changed while the PreferenceActivity is not open, and an issue I'm running into is that addPreferencesFromResource is called in onCreate, so say, I open the PreferenceActivity, then go to another screen from…
Reed
  • 14,703
  • 8
  • 66
  • 110
9
votes
1 answer

what to replace deprecated getFragmentManager() method with (API 28)?

I have an Android application I've been working on, min sdk = 21. In it, I use a custom PreferenceActivity that in turn calls a PreferenceFragment. However, after recently updating to API 28, I noticed that the getFragmentManager() method has been…
9
votes
8 answers

Update existing Preference-item in a PreferenceActivity upon returning from a (sub)PreferenceScreen

I have a PreferenceActivity with a bunch of (Sub)PreferenceScreens. Each such (Sub)PreferenceScreen represents an account and has the account-username as its title. PreferenceScreen root = mgr.createPreferenceScreen(this); for (MyAccountClass…
aioobe
  • 413,195
  • 112
  • 811
  • 826
9
votes
1 answer

How to detect when an inner PreferenceScreen has been closed

I have a inner PreferenceScreen (call it Users) inside another PreferenceScreen (call it Main). When i tap Users a new screen opens and I can change my Preferences there (a lot of CheckBoxes). I want to detect (fire a callback) when this screen is…
9
votes
3 answers

usage of findviewbyid in preferenceactivity

I have a preference screen and i am specifying a layout resource using the android:layout attribute. In the preference activity i am using/inflating the preference using addPreferencesFromResource from onCreate method. Inside the layout i have few…
Adithya
  • 2,923
  • 5
  • 33
  • 47
9
votes
2 answers

preferencefragment no view found for id android

I had the getpreferencescreen deprecated so I tryed to implement the header preference activity. here is my code: public class EditPreferences extends PreferenceActivity { ListPreference m_list_preference_dive_centre_rating; ListPreference…
8
votes
3 answers

Is it possible to combine an EditTextPreference with a CheckBoxPreference?

I have a PreferenceActivity with, among other things, a category including call forward options. What I want is a preference that: Enables/Disables if the user presses a checkbox on the right. Opens up the EditTextPreference dialog if the user…
CodePrimate
  • 6,646
  • 13
  • 48
  • 86