use of io.recom.howabout.category.music.model.TrackList in project howabout-android by recomio.
the class HowaboutApplication method onCreate.
@Override
public void onCreate() {
super.onCreate();
// initialze universal image loader.
DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder().cacheInMemory().cacheOnDisc().build();
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext()).defaultDisplayImageOptions(defaultOptions).build();
ImageLoader.getInstance().init(config);
// saved playlist.
String prefsName = getString(R.string.prefs_name);
SharedPreferences prefs = getSharedPreferences(prefsName, 0);
String trackListJson = prefs.getString("trackListJson", null);
// initialize playlistAdapter to use globally.
if (trackListJson == null) {
playlistAdapter = new MusicPlaylistAdapter(this);
} else {
Gson gson = new Gson();
TrackList trackList = gson.fromJson(trackListJson, TrackList.class);
playlistAdapter = new MusicPlaylistAdapter(this, trackList);
}
MusicPlayerService.setPlaylistAdapter(playlistAdapter);
}
Aggregations