I have a Service in which there are 4 global static int variables 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 is shared preferences are also useful when device restarts?? the code is given below

    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();

and for retrieving

     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);
Edit
Report