title: In data snapshot i couldn't get the values outside from it
body: <p>I've tried several times to get the values of the strings <code>month</code>, <code>firstWeek</code>, <code>secondWeek</code>, and <code>thirdWeek</code> from the <code>DataSnapshot</code> class but I couldn't take the values from the <code>DataSnapshot</code> class to the line <code>monthSalesDataArrayList.add(new MonthSalesData(&quot;1st Week&quot;, firstWeek));</code> (It doesn't work). After that I tried to set the text on the <code>TextView</code> using <code>FirstWeek.setText(firstWeek);</code> it takes the value and displays on the screen but not taking the value on the array. After that I tried with the Toast message whether it shows the value or not but the value doesn't shows on the toast message it's empty there, please help me out to take the <code>DataSnapshot</code> values  to <code>monthSalesDataArrayList.add(new MonthSalesData(&quot;1st Week&quot;, **&quot;to Here&quot;**));</code></p>
  <pre><code>public void takeMonthSales(){
      GetRecord = FirebaseDatabase.getInstance().getReference().child(&quot;Graph&quot;).child(&quot;Record&quot;);
      GetRecord.addValueEventListener(new ValueEventListener() {
          @Override
          public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                  String month = dataSnapshot.child(&quot;Month&quot;).getValue(String.class);
                  String firstWeek = dataSnapshot.child(&quot;1st week&quot;).getValue().toString();
                  String secondWeek = dataSnapshot.child(&quot;2nd week&quot;).getValue().toString();
                  String thirdWeek = dataSnapshot.child(&quot;3rd week&quot;).getValue().toString();
                  String fourthWeek = dataSnapshot.child(&quot;4th week&quot;).getValue().toString();
                  setMonth.setText(&quot;Month of report &quot; + month);
                  FirstWeek.setText(firstWeek);
                  SecondWeek.setText(secondWeek);
                  ThirdWeek.setText(thirdWeek);
                  FourthWeek.setText(fourthWeek);
  
      
  
          }
                  @Override
                  public void onCancelled(@NonNull DatabaseError databaseError) {
      
                  }
              });
      
              Toast.makeText(AdminGraphView.this, &quot;The value is &quot; + FirstWeek.getText().toString(), Toast.LENGTH_SHORT).show();
      
      //This is the array for the barchart values to the graph
          
      
          monthSalesDataArrayList.clear();
          monthSalesDataArrayList.add(new MonthSalesData(&quot;1st Week&quot;, &quot;58454&quot;));
          monthSalesDataArrayList.add(new MonthSalesData(&quot;2nd Week&quot;, &quot;72636&quot;));
          monthSalesDataArrayList.add(new MonthSalesData(&quot;3rd Week&quot;, &quot;62301&quot;));
          monthSalesDataArrayList.add(new MonthSalesData(&quot;4th Week&quot;, &quot;85656&quot;));
          // enter code here
      
          }
  </code></pre>