2020-09-22
程序员文章站
2022-04-12 22:08:55
因为需要用到server 弹出dialog 获取系统级别的dialog .网上百度一直百度,后来发现是参数错了,记录一下 android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(getContext()); builder.setPositiveButton("确定", new DialogInterface....
因为需要用到server 弹出dialog 获取系统级别的dialog .网上百度一直百度,后来发现是参数错了,记录一下
-
android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(getContext()); builder.setPositiveButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { // MyService.this.stopSelf(); // if (windowManager != null) windowManager.removeView(view); } }); AlertDialog dialog = builder.create(); dialog.setMessage("我的计数"); dialog.setTitle("提示"); dialog.getWindow().setType( WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY); dialog.show();
本文地址:https://blog.csdn.net/u013721227/article/details/108739082
上一篇: Android二维码生成与扫码
下一篇: 吐槽各大题库的优劣