Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/392.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java android中的SharedReference(告诉朋友禁用对话框通知)_Java_Android - Fatal编程技术网

Java android中的SharedReference(告诉朋友禁用对话框通知)

Java android中的SharedReference(告诉朋友禁用对话框通知),java,android,Java,Android,我正在开发一个具有共同偏好的android应用程序,包括: -铃声(完成) 禁用对话框通知(警报、短信、彩信)(还没有,请阅读代码中的注释) -告诉朋友(我确定我的代码是正确的,但我不确定如何将其与共享偏好结合起来+我现在确定了我应该放置的位置和方法-请阅读代码中的注释) 这是prefs.xml <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas

我正在开发一个具有共同偏好的android应用程序,包括: -铃声(完成)

  • 禁用对话框通知(警报、短信、彩信)(还没有,请阅读代码中的注释)
-告诉朋友(我确定我的代码是正确的,但我不确定如何将其与共享偏好结合起来+我现在确定了我应该放置的位置和方法-请阅读代码中的注释)

这是prefs.xml

  <?xml version="1.0" encoding="utf-8"?>
  <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >

   <PreferenceCategory android:title="Second Category" >
    <RingtonePreference
        android:name="Ringtone Preference"
        android:key="ringtonePref"
        android:summary="Select a ringtone"
        android:title="Ringtones" />

    <CheckBoxPreference
        android:defaultValue="true"
        android:key="checkbox"
        android:summary="Check the Box"
        android:title="Disable Notification" />
    <Preference
         android:name="tell Preference"
         android:key="tellfriend"
        android:summary="if u want to tell ur friends by usinf"
        android:title="Tell Friend" />
     </PreferenceCategory>

   </PreferenceScreen>


请帮助我,我应该在几个小时后提交它。我解决了我的问题。我只是在另一个活动中告诉朋友,我的代码是正确的

  <?xml version="1.0" encoding="utf-8"?>
  <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >

   <PreferenceCategory android:title="Second Category" >
    <RingtonePreference
        android:name="Ringtone Preference"
        android:key="ringtonePref"
        android:summary="Select a ringtone"
        android:title="Ringtones" />

    <CheckBoxPreference
        android:defaultValue="true"
        android:key="checkbox"
        android:summary="Check the Box"
        android:title="Disable Notification" />
    <Preference
         android:name="tell Preference"
         android:key="tellfriend"
        android:summary="if u want to tell ur friends by usinf"
        android:title="Tell Friend" />
     </PreferenceCategory>

   </PreferenceScreen>