当前位置: 代码迷 >> Android >> android大局dialog
  详细解决方案

android大局dialog

热度:53   发布时间:2016-04-28 05:45:30.0
android全局dialog
public static void showErrorDialog(Context context) {		Builder builder = new AlertDialog.Builder(context);		builder.setMessage("程序发生异常,即将退出");		builder.setIcon(R.drawable.image_dialog);		builder.setNegativeButton("确定", null);		builder.setPositiveButton("取消", null);		AlertDialog alertDialog = builder.create();		alertDialog.getWindow().setType(				WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);		alertDialog.show();	}context 对象可以是Service,Application

<!-- 全局dialog权限 -->

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

?

  相关解决方案