【发布时间】:2019-10-21 05:01:49
【问题描述】:
我有一个问题:我可以在另一个应用程序上显示警报对话框吗?
我想在用户收到消息时通知他。显示标准通知是不够的。但是当我创建一个 AlertDialog 时,它无法显示在其他应用程序上。
private void showAlertDialog(View view, Order order, Order oldOrder) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
LayoutInflater inflater = LayoutInflater.from(context);
View content = inflater.inflate(R.layout.dialog_extra_info, null);
builder.setView(content);
final EditText etKmCounter = content.findViewById(R.id.et_km_counter);
final EditText etMotoHourCounter = content.findViewById(R.id.et_counter_moto_hour);
final AlertDialog ad = builder.show();
Button btnSave = content.findViewById(R.id.save);
btnSave.setOnClickListener(v -> {
if (StringUtils.isEmpty(etKmCounter.getText().toString()) || StringUtils.isEmpty(etMotoHourCounter.getText().toString())) {
openFillDataAlertDialog();
} else {
ad.dismiss();
}
});
}
【问题讨论】:
-
看看推送通知
-
我想你需要的是float window
标签: android