I have a question: Can I show alert Dialog over another application?
I want to notify the user when he received a message. Shows standard notification is not enough. But when I create an AlertDialog, it can't be displayed over other applications.
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();
}
});
}