title: ListView populates but each view is blank at first?
body: <p>I'm using a ListView inside a Fragment which downloads notes from Firebase storage and then displays them. However, the problem I'm running into is when it displays the notes its just a empty note layout, but when I switch activities and go back they're no longer blank, they're loaded. I'm not sure where exactly I'm going wrong, I've tried calling onDataSetChange to the Adapter Everywhere, also tried invalidate() and invalidateViews() on the ListView hoping it would just simply refresh the views, but unfortunately that didnt work either :/ the code is below, thank you in advanced for any help! :)</p>
  
  <p>this is where I'm setting the Adapter in my Notes fragment</p>
  
  <pre><code>mNoteStorage = FirebaseStorage.getInstance().getReference().child("Notes").child(currentUser.getUid());
      mNotesDatabase.addValueEventListener(new ValueEventListener() {
          @Override
          public void onDataChange(DataSnapshot dataSnapshot) {
              my_notes.setAdapter(null);
              Iterable&lt;DataSnapshot&gt; all_keys = dataSnapshot.getChildren();
              filename_arrayList = new ArrayList&lt;&gt;();
              na = null;
              for (DataSnapshot each_key : all_keys) {
                  String each = each_key.getKey();
                  filename_arrayList.add(each);
              }
              for (String each_filename : filename_arrayList) {
                  downloadFile(each_filename);
                  Note each_note = Utilities.getNoteByName(getContext(), each_filename + Utilities.FileExtention);
                  each_note_array.add(each_note);
              }
  
              if (each_note_array == null || each_note_array.size() == 0) {
                  Toast.makeText(getActivity().getApplicationContext(), "No Notes!", Toast.LENGTH_LONG).show();
              } else {
                  na = new MyNotesAdapter(getContext(), R.layout.item_note, each_note_array);
                  my_notes.setAdapter(na);
              }
          }
  
          @Override
          public void onCancelled(DatabaseError databaseError) {
  
          }
      });
  </code></pre>
  
  <p>and Here's my Adapter</p>
  
  <pre><code>class MyNotesAdapter extends ArrayAdapter&lt;Note&gt; {
  
  Context ctx;
  
  public MyNotesAdapter(@NonNull Context context, int resource, ArrayList&lt;Note&gt; note) {
      super(context, resource, note);
  
      this.ctx = context;
  }
  
  @NonNull
  @Override
  public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
      //return super.getView(position, convertView, parent);
  
      if (convertView == null) {
          convertView = LayoutInflater.from(getContext()).inflate(R.layout.item_note, null);
      }
  
      Note note = getItem(position);
  
      if(note != null) {
          TextView title = (TextView) convertView.findViewById(R.id.list_note_title);
          TextView content = (TextView) convertView.findViewById(R.id.list_note_content);
          TextView date = (TextView) convertView.findViewById(R.id.list_note_date);
  
          Typeface music_font = Typeface.createFromAsset(getContext().getAssets(), "fonts/melodymakernotesonly.ttf");
          Typeface scribble_card = Typeface.createFromAsset(getContext().getAssets(), "fonts/the unseen.ttf");
  
          if (getThemeCountInt() == 0) {
              title.setTypeface(music_font);
          } else if (getThemeCountInt() == 1) {
              title.setTypeface(scribble_card);
          }
  
          content.setTypeface(scribble_card);
  
          title.setText(note.getTitle());
          date.setText(note.getDateTimeFormatted(getContext()));
  
          if(note.getContent().length() &gt; 25) {
              content.setText(note.getContent().substring(0,25) + "...");
          } else {
              content.setText(note.getContent());
          }
  
          if(note.getContent().length() &lt;= 0) {
              content.setText("(Empty Note..)");
          } else {
              content.setText(note.getContent());
          }
  
          if (note.getTitle().length() &lt;= 0) {
              title.setText("(Untitled)");
          } else {
              title.setText(note.getTitle());
          }
      }
  
      return convertView;
  }
  
  private int getThemeCountInt() {
      SharedPreferences mSharedPreferences = this.getContext().getSharedPreferences("theme", MODE_PRIVATE);
      int selectedTheme = mSharedPreferences.getInt("theme", 0);
      return selectedTheme;
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>downloadFile</p>
  
  <pre><code>private void downloadFile(final String filenames) {
  
  
      final String each_filename = filenames + Utilities.FileExtention;
      final long file_size = 1024 * 1024;
          mNoteStorage.child(each_filename).getBytes(file_size).addOnSuccessListener(new OnSuccessListener&lt;byte[]&gt;() {
              @Override
              public void onSuccess(byte[] bytes) {
                  FileOutputStream stream;
                  FileInputStream streamIn;
                      try {
                          File dir = getActivity().getApplication().getFilesDir();
                          File file = new File(dir, each_filename);
  
                          stream = new FileOutputStream(file);
                          stream.write(bytes);
  
                      } catch (FileNotFoundException e) {
                          e.printStackTrace();
                      } catch (IOException e) {
                          e.printStackTrace();
                      }
              }
          });
  }
  </code></pre>
  
  <p>Utilities.getNoteByName</p>
  
  <pre><code>public static Note getNoteByName(Context context, String filename) {
      File file = new File(context.getFilesDir(), filename);
      Note note;
  
      if (file.exists()) {
          FileInputStream fis;
          ObjectInputStream ois;
  
          try {
              fis = context.openFileInput(filename);
              ois = new ObjectInputStream(fis);
  
              note = (Note) ois.readObject();
  
              fis.close();
              ois.close();
  
          } catch (IOException | ClassNotFoundException e) {
              e.printStackTrace();
              return null;
          }
  
          return note;
      }
  
      return null;
  }
  </code></pre>