Android – Initialize variable with currently set preference

private int mShuffleMode = SharedPreferences.getInt("shufflemode");

Tells me that a Non-static method can’t be referenced from a static context.

I’m not entirely sure what this means.

What I’m trying to do is initialise the variable with the preference that was set before.