SharedPreferences = getSharedPreferences("application_settings", 0); int id = prefs.getInt("id", 0); if(id > 0) ...
stackoverflow.com