As a beginner in android, I used a ListPreference
in a PreferenceScreen
. But due to unsolvable issues with PreferenceScreen
I decided to use an activity (with LinearLayout
instead of this preference-screen.
But how can I implement something like a ListPreference
in a LinearLayout
? Some 'thing' which I can use to pick an element from the provided list? I tried to just put the whole ListPreference
into the LinearLayout
, which resulted in a runtime-error which I am surely not able to understand:
Didn't find class "android.view.ListPreference" on path: DexPathList[[zip file "/data/app/com.impyiablue.stoxx-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
Here is the relevant part of my LinearLayout
:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar android:id="@+id/toolbar_setting"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"/>
<ListPreference
android:title="@string/UpdateInterval"
android:summary="@string/UpdateIntervalText"
android:key="updateInterval"
android:defaultValue="24"
android:entries="@array/listArray"
android:entryValues="@array/listValues" />
<NumberPicker
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/numberPicker"
android:layout_gravity="center_horizontal" />
....
I searched for something like 'Picker' and 'ListPicker', but that does not seem to exist in the android-realm. So how to do it correctly?