title: RecyclerView.Adapter get item position of my list
body: <p>I have created a <code>RecyclerView.Adapter</code> and I want to fill a list.. so my problem now is I don't know how to implement the get position of my list.</p>
  
  <p>below you can see my code:</p>
  
  <pre><code>public class RecyclerViewAdapter extends RecyclerView.Adapter&lt;RecyclerView.ViewHolder&gt; {
  
      List&lt;Result&gt; _contents;
  
      public RecyclerViewAdapter(List&lt;Result&gt; contents) {
          this._contents = contents;
      }
  
  
      @Override
      public int getItemCount() {
          return _contents.size();
      }
  
      @Override
      public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int position) {
          View view = null;
          view = LayoutInflater.from(parent.getContext())
                  .inflate(R.layout.list_item_card_small, parent, false);
  
          Result tempResult = _contents.get(position);
  
          TextView temp = (TextView) view.findViewById(R.id.text_city_name);
          temp.setText(tempResult.getInfo().getCity().getName());
  
          return new RecyclerView.ViewHolder(view) {
          };
      }
  
      @Override
      public long getItemId(int position) {
          return position;
      }
  
      @Override
      public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
  
         }
      }
  </code></pre>
  
  <p>so the function <code>onCreateViewHolder</code> doesn't get properly the id is always the same id.. how can I fix this or implement to get the right position of mi list?¿ What it´s happening now is the list has the right number of items but is always the same item, the fist one. I guess it´s something simple but I cant figure out how to implement it. </p>
  
  <p>Thanks!!</p>