如何获取通知?在我的应用程序(客户端)中,我没有从服务器收到通知。实际上,我需要的是创建服务器应用程序。它包含使用recyclerview项目的订单列表。当我尝试使用contextmenu更新任何项目时,它将显示微调框包含3个值(“放置”,“途中”,“运送”)。选择并单击“是”后,将向“客户端应用”发送通知。但是我在选择订单状态时没有从服务器收到任何通知。请帮助任何人。
private void showUpdateDialog(String key, final Request item) {
final AlertDialog.Builder alertDialog = new
AlertDialog.Builder(OrderStatus.this);
alertDialog.setTitle("Update Order");
alertDialog.setMessage("Please Choose Status");
LayoutInflater inflater = this.getLayoutInflater();
final View view = inflater.inflate(R.layout.update_order_layout,
null);
spinner = (MaterialSpinner) view.findViewById(R.id.statusSpinner);
spinner.setItems("Placed", "On my way", "Shipped");
alertDialog.setView(view);
final String localKey = key;
alertDialog.setPositiveButton("YES", new
DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
item.setStatus(String.valueOf(spinner.getSelectedIndex()));
requests.child(localKey).setValue(item);
}
});
alertDialog.setNegativeButton("NO", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
alertDialog.show();
}
private void showUpdateDialog(String key, final Request item) {
final AlertDialog.Builder alertDialog = new AlertDialog.Builder(OrderStatus.this);
alertDialog.setTitle("Update Order");
alertDialog.setMessage("Please Choose Status");
LayoutInflater inflater = this.getLayoutInflater();
final View view = inflater.inflate(R.layout.update_order_layout,
null);
spinner = (MaterialSpinner) view.findViewById(R.id.statusSpinner);
spinner.setItems("Placed", "On my way", "Shipped");
alertDialog.setView(view);
final String localKey = key;
alertDialog.setPositiveButton("YES", new
DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
item.setStatus(String.valueOf(spinner.getSelectedIndex()));
requests.child(localKey).setValue(item);
}
});
alertDialog.setNegativeButton("NO", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
alertDialog.show();
}