super.onCreate(icicle);
final NetworkTemplate template = getIntent().getParcelableExtra(EXTRA_NETWORK_TEMPLATE);
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(getLimitedDialogTitleForTemplate(template));
builder.setMessage(R.string.data_usage_disabled_dialog);
builder.setPositiveButton(android.R.string.ok, null);
builder.setNegativeButton(
R.string.data_usage_disabled_dialog_enable, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
snoozePolicy(template);
}
});
final Dialog dialog = builder.create();
dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
public void onDismiss(DialogInterface dialog) {
finish();
}
});
dialog.show();