title: Shared Element Transition Crashing
body: <p>I have a RecyclerView Adapter from which there is an intent to the next Activity</p>
  
  <p>Transition Exit code :</p>
  
  <pre><code>    public ViewHolderEvents onCreateViewHolder(ViewGroup viewGroup, int i) {
  
      if(Build.VERSION.SDK_INT&gt;=21) {
          ((Activity) context).getWindow().setSharedElementExitTransition(TransitionInflater.from(context).inflateTransition(R.transition.shared_element_transition));
      }
  
      View view=layoutInflater.inflate(R.layout.custom_event_row, viewGroup, false);
      ViewHolderEvents viewHolder =new ViewHolderEvents(view);
  
      return viewHolder;
  }`
  </code></pre>
  
  <p>Calling Next Activity:</p>
  
  <pre><code>     if(Build.VERSION.SDK_INT&gt;=21) {
                      ActivityOptionsCompat optionsCompat = ActivityOptionsCompat.makeSceneTransitionAnimation((Activity) context, view.findViewById(R.id.imageView), view.findViewById(R.id.imageView).getTransitionName());
                      ActivityCompat.startActivity((Activity)context, intent, optionsCompat.toBundle());
                  }
                  else
                  {context.startActivity(intent);}
  </code></pre>
  
  <p>There seems to be no issue when pressing a card while first entering the app. But if I use the search (which is another Activity ) and then come back to the main activity, Then on clicking any card the app crashes</p>
  
  <p>Logcat:</p>
  
  <pre><code>    Process: com.squaredbytes.eventlane, PID: 23576
  java.lang.IllegalArgumentException
          at android.os.Parcel.readException(Parcel.java:1544)
          at android.os.Parcel.readException(Parcel.java:1493)
          at android.app.ActivityManagerProxy.isTopOfTask(ActivityManagerNative.java:4504)
          at android.app.Activity.isTopOfTask(Activity.java:5381)
          at android.app.Activity.startActivityForResult(Activity.java:3780)
          at android.app.Activity.startActivity(Activity.java:4023)
          at android.support.v4.app.ActivityCompatJB.startActivity(ActivityCompatJB.java:26)
          at android.support.v4.app.ActivityCompat.startActivity(ActivityCompat.java:98)
          at app.EventAdapter$ViewHolderEvents$1.onClick(EventAdapter.java:142)
          at android.view.View.performClick(View.java:4761)
          at android.view.View$PerformClick.run(View.java:19767)
          at android.os.Handler.handleCallback(Handler.java:739)
          at android.os.Handler.dispatchMessage(Handler.java:95)
          at android.os.Looper.loop(Looper.java:135)
          at android.app.ActivityThread.main(ActivityThread.java:5312)
          at java.lang.reflect.Method.invoke(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:372)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
  </code></pre>
  
  <p>Thanks in Advance.</p>