title: Pass model object to another Activity
body: <p>I have a <code>RecyclerView</code> that utilizes a Recycler Adapter to output a list layout, like this:</p>
  
  <p><a href="http://i.imgur.com/ORkXXTb.png" rel="noreferrer">http://i.imgur.com/ORkXXTb.png</a></p>
  
  <p>I need to attach the model below to each of the list items, such that if the user clicks on any element in the list item (like the circle or one of the two TextViews), it passes the model object to the next <code>Activity</code>.</p>
  
  <p>Here is the <code>User</code> model:</p>
  
  <pre><code>public class User {
  
      private String id;
      private String username;
      private String displayName;
      private Object deletedAt;
      private Statistic stat;
  
      public String getId() {
          return id;
      }
  
      public void setId(String id) {
          this.id = id;
      }
  
      public String getUsername() {
          return username;
      }
  
      public void setUsername(String username) {
          this.username= username;
      }
  
      public String getDisplayName() {
          return displayName;
      }
  
      public void setDisplayName(String displayName) {
          this.displayName = displayName;
      }
  
      public Object getDeletedAt() {
          return deletedAt;
      }
  
      public void setDeletedAt(Object deletedAt) {
          this.deletedAt = deletedAt;
      }
  
      public Statistic getStat() {
          return stat;
      }
  
      public void setStat(Statistic stat) {
          this.stat = stat;
      }
  
  }
  </code></pre>
  
  <p>Here is the layout for each list item (<code>user_layout.xml</code>):</p>
  
  <pre><code>&lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;LinearLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/user_view"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical"&gt;
  
          &lt;RelativeLayout
              xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:background="@color/white"&gt;
  
              &lt;ImageView
                  android:id="@+id/avatar"
                  android:layout_width="50dp"
                  android:layout_height="50dp"
                  android:layout_alignParentLeft="true"
                  android:background="@drawable/avatar" /&gt;
  
  
              &lt;TextView
                  android:id="@+id/display_name"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_alignTop="@+id/avatar"
                  android:layout_toRightOf="@+id/avatar"
                  /&gt;
  
              &lt;TextView
                  android:id="@+id/username"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_below="@+id/display_name"
                  /&gt;
  
          &lt;/RelativeLayout&gt;
  
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Here is the <code>UserRecyclerAdapter</code> that's used to inflate the layout above:</p>
  
  <pre><code>public class UserRecyclerAdapter extends RecyclerView.Adapter&lt;UserRecyclerAdapter.ViewHolder&gt; {
  
      private Context context;
      private List&lt;User&gt; mDataset;
  
      public static class ViewHolder extends RecyclerView.ViewHolder {
          public ImageView avatar;
          public TextView displayName;
          public TextView username;
  
          public ViewHolder(LinearLayout view) {
              super(view);
  
              avatar = (ImageView) view.findViewById(R.id.avatar);
              displayName = (TextView) view.findViewById(R.id.display_name);
              username = (TextView) view.findViewById(R.id.username);
          }
      }
  
      public UserRecyclerAdapter(Context context, List&lt;User&gt; myDataset) {
          this.context = context;
          this.mDataset = myDataset;
      }
  
      @Override
      public UserRecyclerAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.user_layout, parent, false);
          ViewHolder vh = new ViewHolder((LinearLayout) view);
  
          return vh;
      }
  
      @Override
      public void onBindViewHolder(ViewHolder holder, int position) {
          User userItem = mDataset.get(position);
  
          holder.displayName.setText(userItem.getDisplayName());
          holder.username.setText(userItem.getUsername());
      }
  
      @Override
      public int getItemCount() {
          return mDataset.size();
      }
  
  }
  </code></pre>
  
  <p>So my question is, how can I attach the <code>User</code> model object to each list item so that when an element (like the circle or two TextViews) are clicked, it passes the model object to the next <code>Activity</code>?</p>
  
  <p>Thanks.</p>