title: Integer cannot be cast to Long
body: <p>I am keeping track of row ids in the shared preferences for my sqlite database. I was using an int, but then I realized that maybe long would be more adequate for this since the id value could become huge over time. I am getting this error when I try to getLong from shared preference: <em>java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long</em></p>
  
  <pre><code>sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
      editor = sharedPreferences.edit();
      workoutId = sharedPreferences.getLong("workoutId", 0);
  </code></pre>
  
  <p>My workoutId initialize code is a global variable <code>private long workoutId;</code>
  I'm not sure where it is getting integer value from in the error message.
  Or maybe int will suite just fine?</p>