我正在将数据存储在Firebase数据库中。当我更新Firebase数据库时,我想在Android设备上收到通知。当我单击通知时,应将我重定向到相应的活动页面。请帮忙??
private void lecturedetails() {
databaseReference = FirebaseDatabase.getInstance().getReference("Lecture Details");
String date = enterdate.getText().toString().trim();
String subjectname = entersubjectname.getText().toString().trim();
String time = entertime.getText().toString().trim();
if (TextUtils.isEmpty(date)) {
Toast.makeText(this, "Enter Date", Toast.LENGTH_SHORT).show();
return;
}
else if (TextUtils.isEmpty(subjectname)) {
Toast.makeText(this, "Enter Subject", Toast.LENGTH_SHORT).show();
return;
}
else if (TextUtils.isEmpty(time)) {
Toast.makeText(this, "Enter Time", Toast.LENGTH_SHORT).show();
return;
}
else {
String id =databaseReference.push().getKey();
lectureinfo lectureinfo = new lectureinfo(date, subjectname,time);
databaseReference.child(id).setValue(lectureinfo);
Toast.makeText(this, "Data Added", Toast.LENGTH_SHORT).show();
}
}