gpt4 book ai didi

android - 警告对话框下的白色背景

转载 作者:IT老高 更新时间:2023-10-28 23:38:28 30 4
gpt4 key购买 nike

为什么我的警报对话框下会出现这个白色背景。我一直试图找出一个小时的问题,但没有运气。有人可以帮帮我吗?

还有,为什么标题的左右两边有点暗。

enter image description here

protected void onPostExecute(String result) {
//progressDialog.dismiss();
try {
JSONObject json = new JSONObject(result);
String status = json.getString("status");
String message = json.getString("message");
if(status.equals("true")) {
Intent intent = new Intent(context, HomeActivity.class);
intent.putExtra(LoginActivity.EXTRA_MESSAGE, status);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
else{
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setMessage(message)
.setTitle("Error")
.setNeutralButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
}).create().show();
}
} catch (Exception e) {
e.printStackTrace();
}
}

最佳答案

进口 android.support.v7.app.AlertDialog 而不是 android.app.AlertDialog

关于android - 警告对话框下的白色背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29626444/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com