title: How to retrieve data from firebase , without changes in the data?
body: <p>//   This is the MainActivity, I have used firebase to store sample data, where I can update and retrieve. 
  But retrieval of data is possible only when there is a data change,but I want to see my data which is in firebase already
  <a href="https://i.stack.imgur.com/ZMXgU.jpg" rel="nofollow noreferrer">here is the data base structure</a>]<a href="https://i.stack.imgur.com/ZMXgU.jpg" rel="nofollow noreferrer">1</a></p>
  
  <pre><code>public class MainActivity extends 
   AppCompatActivity {
  EditText name,weight;
  Button uploadBtn;
  TextView itemName,itemWeight;
  DatabaseReference databaseReference=FirebaseDatabase.getInstance().getReference();
  Map&lt;String,String&gt;values=new HashMap&lt;&gt;();
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      name=findViewById(R.id.inputItemName);
      weight=findViewById(R.id.inputItemWeight);
      uploadBtn=findViewById(R.id.uploadButton);
      itemName=findViewById(R.id.resultName);
      itemWeight=findViewById(R.id.resultWeight);
  </code></pre>
  
  <p>// Here as you can see I have used an ValueEventListener to show the retrieve values from database before uploading the new Values But it is not working , unless the values of data are changed (that is it works only after uploading new values). </p>
  
  <pre><code> ValueEventListener valueEventListener=new ValueEventListener() {
          @Override
          public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
              String nameD=(String) dataSnapshot.child("Name").getValue();
              String weightD = (String) dataSnapshot.child("Weight").getValue();
              itemName.setText(nameD);
              itemWeight.setText(weightD+" Kg");
          }
  
          @Override
          public void onCancelled(@NonNull DatabaseError databaseError) {
  
          }
      };
      databaseReference.addListenerForSingleValueEvent(valueEventListener);
      uploadBtn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              values.put("Name",name.getText().toString());
              values.put("Weight",weight.getText().toString());
              databaseReference.child("UToouch").setValue(values);
  
          }
      });
  
      databaseReference.addChildEventListener(new ChildEventListener() {
          @Override
          public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
  
          }
  
          @Override
          public void onChildChanged(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
                   String nameDb=(String) dataSnapshot.child("Name").getValue();
                   String weightDb = (String) dataSnapshot.child("Weight").getValue();
                   itemName.setText(nameDb);
                   itemWeight.setText(weightDb+" Kg");
          }
  
          @Override
          public void onChildRemoved(@NonNull DataSnapshot dataSnapshot) {
  
          }
  
          @Override
          public void onChildMoved(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
  
          }
  
          @Override
          public void onCancelled(@NonNull DatabaseError databaseError) {
  
          }
      });
  }
  </code></pre>
  
  <p>}</p>