Search in sources :

Example 1 with RemoteTermPayload

use of org.wordpress.android.fluxc.store.TaxonomyStore.RemoteTermPayload in project WordPress-Android by wordpress-mobile.

the class SelectCategoriesActivity method onActivityResult.

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (data != null) {
        final Bundle extras = data.getExtras();
        switch(requestCode) {
            case ACTIVITY_REQUEST_CODE_ADD_CATEGORY:
                if (resultCode == RESULT_OK) {
                    TermModel newCategory = (TermModel) extras.getSerializable(AddCategoryActivity.KEY_CATEGORY);
                    // Save selected categories
                    updateSelectedCategoryList();
                    mListScrollPositionManager.saveScrollOffset();
                    mSwipeToRefreshHelper.setRefreshing(true);
                    RemoteTermPayload payload = new RemoteTermPayload(newCategory, mSite);
                    mDispatcher.dispatch(TaxonomyActionBuilder.newPushTermAction(payload));
                    break;
                }
        }
    }
}
Also used : Bundle(android.os.Bundle) TermModel(org.wordpress.android.fluxc.model.TermModel) RemoteTermPayload(org.wordpress.android.fluxc.store.TaxonomyStore.RemoteTermPayload)

Aggregations

Bundle (android.os.Bundle)1 TermModel (org.wordpress.android.fluxc.model.TermModel)1 RemoteTermPayload (org.wordpress.android.fluxc.store.TaxonomyStore.RemoteTermPayload)1