为什么所有的arraylist都存储在数据库中?

时间:2018-11-04 15:47:00

标签: android arraylist spinner

问题是,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();
            }
        });

Screenshot of Firebase Realtime Database

0 个答案:

没有答案