title: How to display a listview by comparing values in android
body: <p>I have an app with a listview. Currently it shows all data that I input to the database. I want to display data from firebase database by comparing current time and the time that I input to the database.</p>
  
  <p>here is the code</p>
  
  <pre><code> lv = findViewById(R.id.listView);
          Query query = FirebaseDatabase.getInstance().getReference().child("Details");
          FirebaseListOptions&lt;Member&gt; options = new FirebaseListOptions.Builder&lt;Member&gt;()
                  .setLayout(R.layout.list_view_item)
                  .setQuery(query,Member.class)
                  .build();
          adapter = new FirebaseListAdapter(options) {
              @Override
              protected void populateView(@NonNull View v, @NonNull Object model, int position) {
                  check();
  
                  TextView loc = v.findViewById(R.id.locs);
                  TextView des = v.findViewById(R.id.dests);
                  TextView bus = v.findViewById(R.id.busn);
                  TextView tim = v.findViewById(R.id.time);
  
                  Member db = (Member) model;
                  loc.setText(db.getLocation().toString());
                  des.setText(db.getDestination().toString());
                  bus.setText(db.getBusname().toString());
                  tim.setText(db.getTime().toString());
              }
          };
          lv.setAdapter(adapter);
  
  }
  
   @Override
      protected void onStart() {
          super.onStart();
          adapter.startListening();
      }
  
  
  @Override
      protected void onStop() {
          super.onStop();
          adapter.stopListening();
  }
  </code></pre>
  
  <p>Any error please guide me, I am new in Android. Thanks in Advance :)</p>