Search in sources :

Example 1 with Photoset

use of com.googlecode.flickrjandroid.photosets.Photoset in project glimmr by brk3.

the class PhotosetViewerActivity method onRestoreInstanceState.

@Override
protected void onRestoreInstanceState(Bundle bundle) {
    super.onRestoreInstanceState(bundle);
    Gson gson = new Gson();
    if (mPhotoset == null) {
        String json = bundle.getString(KEY_PHOTOSET);
        if (json != null) {
            mPhotoset = gson.fromJson(json, Photoset.class);
        } else {
            Log.e(TAG, "No photoset found in savedInstanceState");
        }
    }
    if (mUser == null) {
        String json = bundle.getString(KEY_USER);
        if (json != null) {
            mUser = new Gson().fromJson(json, User.class);
        } else {
            Log.e(TAG, "No user found in savedInstanceState");
        }
    }
    mPhotoset.setOwner(mUser);
    initViewPager();
    updateBottomOverlay();
}
Also used : User(com.googlecode.flickrjandroid.people.User) Photoset(com.googlecode.flickrjandroid.photosets.Photoset) Gson(com.google.gson.Gson)

Aggregations

Gson (com.google.gson.Gson)1 User (com.googlecode.flickrjandroid.people.User)1 Photoset (com.googlecode.flickrjandroid.photosets.Photoset)1