preferencefragment

androidx.preference.PreferenceScreen not found when creating Preferences screen

醉酒当歌 提交于 2021-01-26 22:09:12
问题 After following this tutorial to create a screen for preferences, there seems to be a problem with inflating the class 'androidx.preference.PreferenceScreen'. Why is it not found when my preferences have been declared inside the res/xml folder and the necessary dependency has been added to this project? My app's minSdkVersion is 24. Error inflating class (not found)androidx.preference.PreferenceScreen dependencies dependencies { implementation fileTree(dir: 'libs', include: ['*.jar'])

androidx.preference.PreferenceScreen not found when creating Preferences screen

一个人想着一个人 提交于 2021-01-26 22:00:48
问题 After following this tutorial to create a screen for preferences, there seems to be a problem with inflating the class 'androidx.preference.PreferenceScreen'. Why is it not found when my preferences have been declared inside the res/xml folder and the necessary dependency has been added to this project? My app's minSdkVersion is 24. Error inflating class (not found)androidx.preference.PreferenceScreen dependencies dependencies { implementation fileTree(dir: 'libs', include: ['*.jar'])

androidx.preference.PreferenceScreen not found when creating Preferences screen

可紊 提交于 2021-01-26 22:00:19
问题 After following this tutorial to create a screen for preferences, there seems to be a problem with inflating the class 'androidx.preference.PreferenceScreen'. Why is it not found when my preferences have been declared inside the res/xml folder and the necessary dependency has been added to this project? My app's minSdkVersion is 24. Error inflating class (not found)androidx.preference.PreferenceScreen dependencies dependencies { implementation fileTree(dir: 'libs', include: ['*.jar'])

PreferenceFragmentCompat padding issue with @style/PreferenceThemeOverlay

流过昼夜 提交于 2020-01-13 06:17:07
问题 While using the default PreferenceThemeOverlay from the preference-v7 support library (version 23.1.0) I ran into the following issue. Starting from API 22 my PreferenceFragmentCompat had an ugly additional padding added to the left and right side of my preference list. build.gradle: compile 'com.android.support:appcompat-v7:23.1.0' styles.xml: <item name="preferenceTheme">@style/PreferenceThemeOverlay</item> After I didn't find any helpful solution on stackoverflow I wrote a workaround

How to create PreferenceFragment associated with a sliding drawer in android

╄→尐↘猪︶ㄣ 提交于 2020-01-06 15:04:14
问题 My app has a sliding drawer menu,in which i need to load the preferenceFragment in one of the fragment of the sliding menu.I created a code where preferenceFragment is loaded into fragment but when i close the drawer the prefrenceFragment is not disappearing.I can close it only by pressing back button.My complete code and app image is displayed below.Please help me? Settings Fragment public class Settings_fragment extends Fragment { public Settings_fragment(){} @Override public View

PreferenceFragment no scroll in CollapsingToolbarLayout

感情迁移 提交于 2020-01-01 09:17:53
问题 I have a problem with PreferenceFragment and CollapsingToolbarLayout. I have a base layout: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/mainLayout" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".activities.base.BaseActivity"> <android.support.design.widget.AppBarLayout

Show up-Button in actionBar in subscreen preferences

淺唱寂寞╮ 提交于 2019-12-30 03:10:09
问题 I've implemented my preferences like shown in the official guidelines. I have a PreferenceActivity which creates the PreferenceFragment like this: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle extras = getIntent().getExtras(); if (extras != null) { Bundle bundle = new Bundle(); _widgetID = extras.getInt(GlobalSettings.EXTRA_WIDGET_ID); bundle.putInt(GlobalSettings.EXTRA_WIDGET_ID, _widgetID); WidgetSettingsFragment fragment = new

Android PreferenceFragment No view found for id for fragment

六眼飞鱼酱① 提交于 2019-12-22 10:36:32
问题 So I'm making an android application and I started dealing with preferences, when I simply use a PreferenceActivity, everything works perfectly, however, if I use it with a PreferenceFragment, it crashes right after I click the button that calls intents to SettingsActivity with an error: FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{*app package*/*app package*.SettingsActivity}: java.lang.IllegalArgumentException: No view found for id 0x7f08003d for

ScrollView > LinearLayout > PreferenceFragment is zero height

北战南征 提交于 2019-12-22 05:16:24
问题 I have an activity that has a ScrollView with a vertical LinearLayout that has two fragments that are PreferenceFragment instances as shown in the following layout file: <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_height="wrap_content" android:layout_width="match_parent" > <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" tools:context=

How to open a new PreferenceFragment from current one, using the new Android-X API?

微笑、不失礼 提交于 2019-12-19 20:43:21
问题 Background On previous versions of support library, we could use headers in order to have a main-menu screen of settings, that each would open a new settings screen (fragment) . The problem Now headers are gone (as written here) for some time, and I think it became worse on android-x : One thing you’ll note isn’t in here is preference headers and you’d be totally right. However, that doesn’t mean a single list of preferences need to span a 10” tablet screen. Instead, your Activity can