title: Database not update the value
body: <p>I am trying to make a social app .. and I want when the user clicks the edit category database should be updated to the new value .. but it is like static not changing to new value .. I don't know the problem in logic or in the code ..</p>
  <pre><code>    private void showCategoryUpdateDialog(String Key) {
      AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
      builder.setTitle(&quot;تغيير &quot; + Key);
  
  
      LinearLayout linearLayout = new LinearLayout(getActivity());
      linearLayout.setOrientation(LinearLayout.VERTICAL);
      linearLayout.setPadding(15, 10, 15, 10);
  
      RadioButton radioButton = new RadioButton(getActivity());
      radioButton.setText(&quot;علمي علوم&quot;);
      RadioButton radioButton2 = new RadioButton(getActivity());
      radioButton2.setText(&quot;علمي رياضة&quot;);
      RadioButton radioButton3 = new RadioButton(getActivity());
      radioButton3.setText(&quot;أدبي&quot;);
  
      linearLayout.addView(radioButton);
      linearLayout.addView(radioButton2);
      linearLayout.addView(radioButton3);
  
      builder.setView(linearLayout);
      builder.setPositiveButton(&quot;Update&quot;, new DialogInterface.OnClickListener() {
          @Override
          public void onClick(DialogInterface dialog, int which) {
              String value = radioButton.getText().toString().trim();
              String value2 = radioButton2.getText().toString().trim();
              String value3 = radioButton3.getText().toString().trim();
  
              if (!TextUtils.isEmpty(value)) {
                  pd.show();
                  HashMap&lt;String, Object&gt; result = new HashMap&lt;&gt;();
                  result.put(Key, value);
  
                  databaseReference.child(user.getUid()).updateChildren(result)
                          .addOnSuccessListener(new OnSuccessListener&lt;Void&gt;() {
                              @Override
                              public void onSuccess(Void aVoid) {
                                  pd.dismiss();
                                  Toast.makeText(getActivity(), &quot;Updated...&quot;, Toast.LENGTH_SHORT).show();
                              }
                          }).addOnFailureListener(new OnFailureListener() {
                      @Override
                      public void onFailure(@NonNull Exception e) {
                          pd.dismiss();
                          Toast.makeText(getActivity(), &quot;&quot; + e.getMessage(), Toast.LENGTH_SHORT).show();
  
                      }
                  });
  
  
              } else {
                  Toast.makeText(getActivity(), &quot;Please enter &quot; + Key, Toast.LENGTH_SHORT).show();
  
              }
  
              if (!TextUtils.isEmpty(value2)) {
                  pd.show();
                  HashMap&lt;String, Object&gt; result2 = new HashMap&lt;&gt;();
                  result2.put(Key, value2);
  
                  databaseReference.child(user.getUid()).updateChildren(result2)
                          .addOnSuccessListener(new OnSuccessListener&lt;Void&gt;() {
                              @Override
                              public void onSuccess(Void aVoid) {
                                  pd.dismiss();
                                  Toast.makeText(getActivity(), &quot;Updated...&quot;, Toast.LENGTH_SHORT).show();
                              }
                          }).addOnFailureListener(new OnFailureListener() {
                      @Override
                      public void onFailure(@NonNull Exception e) {
                          pd.dismiss();
                          Toast.makeText(getActivity(), &quot;&quot; + e.getMessage(), Toast.LENGTH_SHORT).show();
  
                      }
                  });
  
  
              } else {
                  Toast.makeText(getActivity(), &quot;Please enter &quot; + Key, Toast.LENGTH_SHORT).show();
  
              }
  
              if (!TextUtils.isEmpty(value3)) {
                  pd.show();
                  HashMap&lt;String, Object&gt; result3 = new HashMap&lt;&gt;();
                  result3.put(Key, value3);
  
                  databaseReference.child(user.getUid()).updateChildren(result3)
                          .addOnSuccessListener(new OnSuccessListener&lt;Void&gt;() {
                              @Override
                              public void onSuccess(Void aVoid) {
                                  pd.dismiss();
                                  Toast.makeText(getActivity(), &quot;Updated...&quot;, Toast.LENGTH_SHORT).show();
                              }
                          }).addOnFailureListener(new OnFailureListener() {
                      @Override
                      public void onFailure(@NonNull Exception e) {
                          pd.dismiss();
                          Toast.makeText(getActivity(), &quot;&quot; + e.getMessage(), Toast.LENGTH_SHORT).show();
  
                      }
                  });
  
  
              } else {
                  Toast.makeText(getActivity(), &quot;Please enter &quot; + Key, Toast.LENGTH_SHORT).show();
  
              }
  
          }
      });
      builder.setNegativeButton(&quot;Cancel&quot;, new DialogInterface.OnClickListener() {
          @Override
          public void onClick(DialogInterface dialog, int which) {
  
          }
      });
  
      builder.create().show();
  
  }
  </code></pre>
  <p>In this picture have more details</p>
  <p><a href="https://i.stack.imgur.com/OfY2L.png" rel="nofollow noreferrer">Emulator</a></p>
  <p>And this GIF from my Database</p>
  <p><a href="https://i.stack.imgur.com/bD6go.gif" rel="nofollow noreferrer"><a href="https://media.giphy.com/media/ZY36QuzJsdXIhIQh7k/giphy.gif" rel="nofollow noreferrer">https://media.giphy.com/media/ZY36QuzJsdXIhIQh7k/giphy.gif</a></a></p>