问题是,tuitionPackage的数据未在firebase数据库中显示/保存。学费包数据为微调框类型。
这是我的代码:
ArrayList<TuitionPackage> tuitionPackages = new ArrayList<>();
tuitionPackages.add(new TuitionPackage());
tuitionPackages.addAll(mAdvertisement.getTuitionPackages());
StudentRegistration studentRegistration = new StudentRegistration(uid, tuitioname, fullname, icnum, homeaddress, parentname, parentcontactnum, userUid, tuitionPackages);
mDatabase.child("Student Registration").child(uid).setValue(studentRegistration).addOnCompleteListener(new OnCompleteListener<Void>()
{
@Override
public void onComplete(@NonNull Task<Void> task)
{
if(task.isSuccessful())
{
Toast.makeText(RegisterActivity.this, "Successfully registered!", Toast.LENGTH_SHORT).show();
startActivity(new Intent(RegisterActivity.this, FinishActivity.class));
finish();
}
else
{
Toast.makeText(RegisterActivity.this, task.getException().getMessage(), Toast.LENGTH_SHORT).show();
}
loadingBar.dismiss();
}
});