use of com.sdsmdg.harjot.MusicDNA.models.RecentlyPlayed in project MusicDNA by harjot-oberai.
the class HomeActivity method getSavedData.
private void getSavedData() {
try {
Gson gson = new Gson();
Log.d("TIME", "start");
String json2 = mPrefs.getString("allPlaylists", "");
allPlaylists = gson.fromJson(json2, AllPlaylists.class);
Log.d("TIME", "allPlaylists");
String json3 = mPrefs.getString("queue", "");
queue = gson.fromJson(json3, Queue.class);
Log.d("TIME", "queue");
String json4 = mPrefs.getString("recentlyPlayed", "");
recentlyPlayed = gson.fromJson(json4, RecentlyPlayed.class);
Log.d("TIME", "recents");
String json5 = mPrefs.getString("favouriteTracks", "");
favouriteTracks = gson.fromJson(json5, Favourite.class);
Log.d("TIME", "fav");
String json6 = mPrefs.getString("queueCurrentIndex", "");
queueCurrentIndex = gson.fromJson(json6, Integer.class);
Log.d("TIME", "queueCurrentindex");
String json8 = mPrefs.getString("settings", "");
settings = gson.fromJson(json8, Settings.class);
Log.d("TIME", "settings");
String json9 = mPrefs.getString("equalizer", "");
equalizerModel = gson.fromJson(json9, EqualizerModel.class);
Log.d("TIME", "equalizer");
String json = mPrefs.getString("savedDNAs", "");
savedDNAs = gson.fromJson(json, AllSavedDNA.class);
Log.d("TIME", "savedDNAs");
} catch (Exception e) {
e.printStackTrace();
}
try {
String json7 = mPrefs.getString("versionCode", "");
prevVersionCode = gson.fromJson(json7, Integer.class);
Log.d("TIME", "VersionCode : " + prevVersionCode + " : " + versionCode);
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations