如何向用户发送包含时间和日期的通知?用户完成预约后,它将向用户发送通知,让用户知道日期和时间。任何人都可以帮助我
私有 TextView mDate;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_view_user_information);
mDate = (TextView) findViewById(R.id.tvdate);
//declare the database reference object. This is what we use to access the database.
//NOTE: Unless you are signed in, this will not be useable.
mAuth = FirebaseAuth.getInstance();
mFirebaseDatabase = FirebaseDatabase.getInstance();
myRef = mFirebaseDatabase.getReference();
buttonBack = (Button) findViewById(R.id.btnBack);
final FirebaseUser user = mAuth.getCurrentUser();
userID = user.getUid();
buttonBack.setOnClickListener(this);
// Read from the database
myRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
mDate.setText(dataSnapshot.child(userID).child("Appointment").child("date").getValue(String.class));
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}