title: addpreferencesfromresource Deprecated explanation
body: <p>I would like to know how to use this method <code>addPreferenceFromResource()</code> as this is now deprecated in Preference Activity.</p>
  
  <p>I went through these links,</p>
  
  <p><a href="https://stackoverflow.com/questions/6822319/what-to-use-instead-of-addpreferencesfromresource-in-a-preferenceactivity">Link 1</a></p>
  
  <p><a href="https://stackoverflow.com/questions/16374492/alternative-to-addpreferencesfromresource-as-its-deprecated">Link 2</a></p>
  
  <p><a href="https://stackoverflow.com/questions/18998590/the-method-addpreferencesfromresourceint-from-the-type-preferenceactivity-is-d">Link 3</a></p>
  
  <p>and also through the official documentation and other links, but I could not understand this as I am only a beginner. </p>
  
  <p>Can anyone just provide me the source code of a simple preference like checkbox, it would be helpful to understand as I am only a beginner.</p>
  
  <p>I do not need the explanation of the code, I would need only the source code of the XML as well as the Java Class. </p>
  
  <p>I know this is some kind of home-work like thing, at-least some links would also do. Anything you are comfortable with.</p>