在服务启动对话框时不依赖Activity


在服务启动对话框不依赖Activity
 Builder builder=new Builder(getApplicationContext());
builder.setTitle("Title");
builder.setMessage("This is message");
builder.setNegativeButton("OK", null);
Dialog dialog=builder.create();
dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
dialog.show();
权限
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

 
阅读更多

没有更多推荐了,返回首页