title: I don't know how to read realtime database and get some children data to insert those firestore database
body: <p>I'm new in firebase and I am trying to get data from firebase database and insert them(nickname, userDescription, profileImage, pictureOne, pictureTwo) to Firestore database.</p>
  <p>The problem is that the code return null when I execute datasnapshot. Can anyone help me? I would really thankful if anyone could help me. Thank you in advance!</p>
  <p>My realtime database</p>
  <p><img src="https://i.stack.imgur.com/EaQHk.png" alt="enter image description here" /></p>
  <p>My Java Code:</p>
  <pre><code>public class SettingsActivity extends AppCompatActivity
  {
      private FirebaseFirestore db;
  
      private FirebaseDatabase mFirebaseDatabase;
      DatabaseReference AllUsersProfileRef;
  
      private FirebaseAuth mAuth;
  
      private Toolbar mToolbar;
      private ProgressDialog loadingBar;
  
      @Override
      protected void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_settings);
  
          mAuth= FirebaseAuth.getInstance();
          currentUserID = mAuth.getCurrentUser().getUid();
          getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
  
          loadingBar = new ProgressDialog(this);
  
          db = FirebaseFirestore.getInstance();
  
          mFirebaseDatabase = FirebaseDatabase.getInstance();
          AllUsersProfileRef= mFirebaseDatabase.getReference();
  
  
          FirebaseStorage.getInstance().getReference();
  
          settingsSaveButton.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  loadingBar.setTitle(&quot;자기소개 저장&quot;);
                  loadingBar.setMessage(&quot;자기소개 저장중이니 기다리세요&quot;);
                  loadingBar.setCanceledOnTouchOutside(true);
                  loadingBar.show();
  
                  SaveDataToFirestore();
                  RetrieveDataFromFirebase();
              }
          });
      }
  
      private void RetrieveDataFromFirebase()
      {
          DatabaseReference AllUsersProfileRef = FirebaseDatabase.getInstance().getReference(&quot;allUsers&quot;);
          AllUsersProfileRef.addListenerForSingleValueEvent(new ValueEventListener() {
                       @Override
                       public void onDataChange(@NonNull DataSnapshot snapshot)
                       {
                           for (DataSnapshot dsp : snapshot.getChildren())
                           {
                               Users users = dsp.getValue(Users.class);
  
                               nickname = users.getNickname();
                               userDescription = users.getUserDescription();
                               profileImage = users.getProfileImage();
                               pictureOne = users.getPictureOne();
                               pictureTwo = users.getPictureTwo();
                           }
                       }
  
                       @Override
                       public void onCancelled(@NonNull DatabaseError error) {
  
                       }
                   });
      }
  
  
      private void SaveDataToFirestore()
      {
          Map&lt;String, Object&gt; profile = new HashMap&lt;&gt;();
  
          profile.put(&quot;nickname&quot;, nickname );
          profile.put(&quot;userDescription&quot;, userDescription );
          profile.put(&quot;profileImage&quot;, profileImage );
          profile.put(&quot;pictureOne&quot;, pictureOne );
          profile.put(&quot;pictureTwo&quot;, pictureTwo );
          profile.put(&quot;currentUserID&quot;, currentUserID);
          profile.put(&quot;marriage&quot;, marriage);
          profile.put(&quot;gender&quot;, gender);
          profile.put(&quot;timestamp&quot;, FieldValue.serverTimestamp());
          profile.put(&quot;age&quot;, a);
          profile.put(&quot;school&quot;, school);
          profile.put(&quot;occupation&quot;, occupation);
          profile.put(&quot;salary&quot;, salary);
          profile.put(&quot;address&quot;, address);
          profile.put(&quot;height&quot;, height);
          profile.put(&quot;weight&quot;, weight);
          profile.put(&quot;blood&quot;, blood);
          profile.put(&quot;leadership&quot;, leadership);
          profile.put(&quot;religion&quot;, religion);
          profile.put(&quot;housing&quot;, housing);
          profile.put(&quot;manWealth&quot;, manWealth);
          profile.put(&quot;hobbyOne&quot;, hobbyOne);
          profile.put(&quot;hobbyTwo&quot;, hobbyTwo);
          profile.put(&quot;hobbyThree&quot;, hobbyThree);
          profile.put(&quot;hobbyFour&quot;, hobbyFour);
          profile.put(&quot;hobbyFive&quot;, hobbyFive);
          profile.put(&quot;hobbySix&quot;, hobbySix);
  
          db.collection(&quot;usersProfiles&quot;).document()
                  .set(profile)
                  .addOnSuccessListener(new OnSuccessListener&lt;Void&gt;() {
                      @Override
                      public void onSuccess(Void aVoid)
                      {
                          SendUserToProfileActivity();
                          Toast.makeText(SettingsActivity.this, &quot;프로필 데이터 저장&quot;, Toast.LENGTH_SHORT).show();
                          loadingBar.dismiss();
                      }
                  }).addOnFailureListener(new OnFailureListener()
          {
              @Override
              public void onFailure(@NonNull Exception e)
              {
                  Toast.makeText(SettingsActivity.this, &quot;프로필 데이터 저장실패&quot;, Toast.LENGTH_SHORT).show();
                  loadingBar.dismiss();
              }
          });
      }
  }
  </code></pre>
  <p>My Firestore Db Result:</p>
  <p><img src="https://i.stack.imgur.com/kFKxp.png" alt="enter image description here" /></p>
  <p>realtime database child data such as nickname, userDescription, profileImage, pictureOne, pictureTwo did not saved.
  the others are saved.</p>
  
  <p>2021-01-29 08:53:53.544 16107-16107/? E/Zygote: isWhitelistProcess - Process is Whitelisted
  2021-01-29 08:53:53.545 16107-16107/? E/Zygote: accessInfo : 1
  2021-01-29 08:54:11.183 16107-16107/com.maintoppartners.jakiya_hun E/ViewRootImpl: sendUserActionEvent() returned.
  2021-01-29 08:54:15.464 16107-16107/com.maintoppartners.jakiya_hun E/ViewRootImpl: sendUserActionEvent() returned.
  2021-01-29 08:54:18.494 16107-16107/com.maintoppartners.jakiya_hun E/ViewRootImpl: sendUserActionEvent() returned.
  2021-01-29 08:54:30.506 16107-16107/com.maintoppartners.jakiya_hun E/ViewRootImpl: sendUserActionEvent() returned.</p>