title: How to used a shared transition from RecyclerView to a Fragment
body: <p>I've seen this questioned asked a number of times on here without an answer. I'm hoping if I ask it again maybe someone will be kind enough to help me with it.  </p>
  
  <p>I'm trying to implement a shared transition from an Item in a Recyclerview to a fragment. </p>
  
  <p>I currently have my fragment transaction in the onBindView method of the adapter. </p>
  
  <pre><code>public void onClick(View v) {
      ...
      activity.getSupportFragmentMnager().beginTransaction()
              .addSharedElement(v, "SharedString")
              .replace(R.id.container, fragment2)
              .addToBackStack(null)
              .commit();
  }
  </code></pre>
  
  <p>In the <a href="https://developer.android.com/reference/android/support/v4/app/FragmentTransaction.html#addsharedelement" rel="nofollow noreferrer">android docs</a>, addSharedElement(view and string) confuse me. How do I give the view a unique ID and should I even be using v here?</p>
  
  <p>Can the string be what ever I want?   </p>