title: Return to Activity with correct Transition or without Shared Element Transition
body: <p>i used <a href="https://guides.codepath.com/android/Shared-Element-Activity-Transition" rel="nofollow noreferrer">this</a> guide to make a simple RecyclerView (in a fragment) to Activity Shared Element Transition with multiple elements and it all worked fine up the point i am trying to get back. Althought i pass the ViewHolder as seen below sometimes the return animation ends up on different element on the RecyclerView which is really bad.</p>
  
  <pre><code> public void onPetClicked(PetRecyclerViewAdapter.PetViewHolder holder, int position) {
  
              Intent newPostIntent = new Intent(getActivity(), PostDetailsActivity.class);
              newPostIntent.putExtra("TYPE", mPostType);
              newPostIntent.putExtra("POSTED_PET",  mPetList.get(position));
  
              Pair&lt;View, String&gt; area = Pair.create(holder.itemView.findViewById(R.id.removable), "content_area");
              Pair&lt;View, String&gt; p1 = Pair.create(holder.itemView.findViewById(R.id.ivPetImage), "petImage");
              Pair&lt;View, String&gt; p2 = Pair.create(holder.itemView.findViewById(R.id.tvTitle), "postTitle");
              Pair&lt;View, String&gt; p3 = Pair.create(holder.itemView.findViewById(R.id.tvInfo), "postDescription");
              Pair&lt;View, String&gt; p4 = Pair.create(holder.itemView.findViewById(R.id.rlDate), "postDate");
              Pair&lt;View, String&gt; p5 = Pair.create(holder.itemView.findViewById(R.id.rlLocation), "postLocation");
              ActivityOptionsCompat options = ActivityOptionsCompat.
                      makeSceneTransitionAnimation(getActivity(), area, p1, p2, p3, p4,p5);
  
              getActivity().startActivity(newPostIntent, options.toBundle());
  </code></pre>
  
  <p>Not being able to fix this i decided to actually not use a return animation so in my second activity i replaced</p>
  
  <pre><code> @Override
      public void onBackPressed(){
          super.onBackPressed();
          supportFinishAfterTransition();
      }
  </code></pre>
  
  <p>with </p>
  
  <pre><code>@Override
      public void onBackPressed(){
          super.onBackPressed();
           finish();
           overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
      }
  </code></pre>
  
  <p>but now when i go back all shared elements are empty!</p>
  
  <p>So, i am trying to figure a way, either to make the return transition work properly, meaning the "fading" effects to fade on the correct item, OR to remove the return transition all together.</p>
  
  <p>Edit: On the direction of actually making it work I tried to obtain and use the View that was clicked instead of the ViewHolder but again, i got the same results. As soon as i was scrolling the recycler view and opening an item, the views would animate back to a row different than the one they started.</p>
  
  <pre><code> public void onPetClicked(View view, PetRecyclerViewAdapter.PetViewHolder holder, int position) {
              mPetList.get(position);
  
              Intent newPostIntent = new Intent(getActivity(), PostDetailsActivity.class);
              newPostIntent.putExtra("TYPE", mPostType);
              newPostIntent.putExtra("POSTED_PET",  mPetList.get(position));
  
              Pair&lt;View, String&gt; area = Pair.create(view.findViewById(R.id.removable), "content_area");
              Pair&lt;View, String&gt; p1 = Pair.create(view.findViewById(R.id.ivPetImage), "petImage");
              Pair&lt;View, String&gt; p2 = Pair.create(view.findViewById(R.id.tvTitle), "postTitle");
              Pair&lt;View, String&gt; p3 = Pair.create(view.findViewById(R.id.tvInfo), "postDescription");
              Pair&lt;View, String&gt; p4 = Pair.create(view.findViewById(R.id.rlDate), "postDate");
              Pair&lt;View, String&gt; p5 = Pair.create(view.findViewById(R.id.rlLocation), "postLocation");
              ActivityOptionsCompat options = ActivityOptionsCompat.
                      makeSceneTransitionAnimation(getActivity(), area, p1, p2, p3, p4,p5);
  
              getActivity().startActivity(newPostIntent, options.toBundle());
          }
      });
  </code></pre>