title: Displaying ParseFile Containing Images Using Their Urls In A RecyclerView
body: <p>I have three images stored in a table on Parse.com and I would like to display those three images using their URLs. </p>
  
  <p>I have retrieved the URLs of the three images and they are displayed in the RecyclerView. You can see this in my screen shot image.</p>
  
  <p>So how do I display these three images using their URLs? </p>
  
  <p><strong>MY MAIN ACTIVITY:</strong></p>
  
  <pre><code>public class RecyclerViewActivity extends Activity {
  
  private List&lt;Person&gt; persons;
  private RecyclerView rv;
  
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      setContentView(R.layout.recyclerview_activity);
  
      rv=(RecyclerView)findViewById(R.id.rv);
  
      LinearLayoutManager llm = new LinearLayoutManager(this);
      rv.setLayoutManager(llm);
      rv.setHasFixedSize(true);
  
      initializeData();
      initializeAdapter();
  }
  
  private void initializeData(){
      persons = new ArrayList&lt;&gt;();
  
      //Query to load String data into the card view/recycler view
      ParseQuery&lt;ParseObject&gt; query = ParseQuery.getQuery("events");
      query.findInBackground(new FindCallback&lt;ParseObject&gt;() {
          @Override
          public void done(List&lt;ParseObject&gt; objects, ParseException e) {
  
              if (e == null) {
  
                  for (int i = 0; i &lt; objects.size(); i++) {
  
  
  
                      persons.add(new Person(objects.get(i).getString("name"), objects.get(i).getString("shortinfo"), objects.get(i).getParseFile("image"), img[i]));
  
                  }
              } else {
                  // something went wrong
              }
  
  
              initializeAdapter();
          }
      });
  
       }
  
  private void initializeAdapter(){
      RVAdapter adapter = new RVAdapter(persons);
      rv.setAdapter(adapter);
  }
  }
  </code></pre>
  
  <p><strong>MY ADAPTER:</strong></p>
  
  <pre><code>public class RVAdapter extends RecyclerView.Adapter&lt;RVAdapter.PersonViewHolder&gt; {
  
  public static class PersonViewHolder extends RecyclerView.ViewHolder {
  
      CardView cv;
      TextView personName;
      TextView personAge;
      ParseImageView personPhoto;
      TextView personPhoto1;
  
      PersonViewHolder(View itemView) {
          super(itemView);
          cv = (CardView)itemView.findViewById(R.id.cv);
          personName = (TextView)itemView.findViewById(R.id.person_name);
          personAge = (TextView)itemView.findViewById(R.id.person_age);
          personPhoto = (ParseImageView)itemView.findViewById(R.id.person_photo);
          personPhoto1 = (TextView)itemView.findViewById(R.id.person_photo1);
  
      }
  }
  
  List&lt;Person&gt; persons;
  
  RVAdapter(List&lt;Person&gt; persons){
      this.persons = persons;
  }
  
  @Override
  public void onAttachedToRecyclerView(RecyclerView recyclerView) {
      super.onAttachedToRecyclerView(recyclerView);
  }
  
  @Override
  public PersonViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
      View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item, viewGroup, false);
      PersonViewHolder pvh = new PersonViewHolder(v);
      return pvh;
  }
  
  @Override
  public void onBindViewHolder(PersonViewHolder personViewHolder, int i) {
      personViewHolder.personName.setText(persons.get(i).name);
      personViewHolder.personAge.setText(persons.get(i).age);
      personViewHolder.personPhoto.setParseFile(persons.get(0).photoId);
      personViewHolder.personPhoto1.setText(persons.get(i).photoId1);
      //personViewHolder.personPhoto.setParseFile(persons.get(2).photoId);
  
  
  }
  
  @Override
  public int getItemCount() {
      return persons.size();
  }
  }
  </code></pre>
  
  <p><strong>MY CLASS CONTAINING MY DATA FOR THE RECYCLER VIEW:</strong></p>
  
  <pre><code>class Person {
  String name;
  String age;
  ParseFile photoId;
  String photoId1;
  
  Person(String name, String age, ParseFile photoId,String photoId1) {
      this.name = name;
      this.age = age;
      this.photoId = photoId;
      this.photoId1 = photoId1;
  }
  }
  </code></pre>