title: Android Shared Preferences not working
body: <p>I have a Service in which there are <strong>4 global static int variables</strong>  and i have a receiver of BOOT COMPLETE and Call event. what I am trying to do is save these 4 variables whenever Call event receiver is execute and Retrieve them when BOOT receiver is executed (of course when I restarted my phone) but Both are not working.. another thing <strong>is shared preferences are also useful when device restarts??</strong> the code is given below</p>
  
  <pre><code>    SharedPreferences saved_values = this.getSharedPreferences(
                "com.example.app", Context.MODE_PRIVATE);
      saved_values.edit().putInt("call", MyService.callcount);
      saved_values.edit().putInt("callend",MyService.callendcount);
      saved_values.edit().putInt("network",MyService.network_count);
      saved_values.edit().putInt("ringing",MyService.ringingcount);
      saved_values.edit().commit();
  </code></pre>
  
  <p>and for retrieving </p>
  
  <pre><code>     SharedPreferences saved_values = this.getSharedPreferences(
                    "com.example.app", Context.MODE_PRIVATE);
            MyService.callcount = saved_values.getInt("call", -10);
            MyService.ringingcount=saved_values.getInt("ringing", -10);
            MyService.    network_count=saved_values.getInt("network", -10);
            MyService.        callendcount=saved_values.getInt("callend", -10);
  </code></pre>