Skip to content

Browse Fragment On Back Reloads all Fragment #10

Description

@indieocean

I managed to get the rows working, but when I click on an item and open up my details activity and go back instead of returning to the row item I just clicked it reloads the complete Browse Fragment again.

Ex.

private final class ItemViewClickedListener implements OnItemViewClickedListener {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
                                  RowPresenter.ViewHolder rowViewHolder, Row row) {
            Log.d(TAG, "OnItemViewClickedListener called");
            if (item instanceof Item) {
                Item mItem = (Item) item;
                Log.d(TAG, "Item: " + item.toString());
                Intent intent = new Intent(MainActivity.this, DetailsActivity.class);
                intent.putExtra(DetailsActivity.ITEM, mItem);

                Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(
                        MainActivity.this,
                        ((ImageCardView) itemViewHolder.view).getMainImageView(),
                        DetailsActivity.SHARED_ELEMENT_NAME).toBundle();
                MainActivity.this.startActivity(intent, bundle);
            }
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions