何らかの処理を行う意図を呼び出す設定に依存する他の設定が必要です。
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
<Preference
android:key="urlpref"
android:summary="summary here"
android:title="title here" >
<intent
android:action="android.intent.action.VIEW"
android:data="http://www.android.com"
android:targetClass="com.example.app.popupactivity"
android:targetPackage="com.example.app" />
</Preference>
<CheckBoxPreference
android:defaultValue="false"
android:key="enablepref"
android:summary="Summary"
android:title="title"
android:dependency="urlpref"/>
基本的に、最初の設定は、ユーザーからの入力を受け取り、共有設定に保存するアクティビティを開始します。
今、私のチェックボックスはそれに基づいて有効または無効になりません。urlpref にも追加してみました
android:disableDependentsState="true"
それで、それを行う適切な方法は何ですか?