AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setIcon(R.drawable.ic_new_version);
builder.setTitle("标题");
builder.setMessage("内容");
builder.setPositiveButton("确定", new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
});
builder.setCancelable(false);
AlertDialog dialog = builder.create();
dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);//指定会全局,可以在后台弹出
dialog.setCanceledOnTouchOutside(false);
dialog.show();
但是要增加一个权限