When I run below codes I get this error message : "020-11-07 18:45:26.737 20684-20684/com.user.example E/WindowManager: android.view.WindowLeaked: Activity com.user.example.Pages.Dashboard.Home has leaked window DecorView@14fe64f[Home] that was originally added here" but my application still run without crash. How can I fix that problem _
These codes belong to an activity.
public void login(View v) {
if( !validateUserEmail() | !validatePassword()){
return;
}
UserInfo userInfo = new UserInfo(mail,password);
SendRequestToAPI.sendRequest(userInfo,Login.this);
}
These codes belong to a class which name is SendRequestToAPI.
public static void showWarningAlert(final Context context, String title,
String contentText, String confirmText){
SweetAlertDialog alertDialog = new
SweetAlertDialog(context,SweetAlertDialog.WARNING_TYPE);
alertDialog.setTitle(title);
alertDialog.setContentText(contentText);
alertDialog.setConfirmText(confirmText);
alertDialog.setConfirmClickListener(new
SweetAlertDialog.OnSweetClickListener() {
@Override
public void onClick(SweetAlertDialog sweetAlertDialog) {
Intent intent = new Intent(context, Login.class);
context.startActivity(intent);
((Activity)context).finish();
}
}).setCancelButton("Cancel", new
SweetAlertDialog.OnSweetClickListener() {
@Override
public void onClick(SweetAlertDialog sweetAlertDialog) {
sweetAlertDialog.dismissWithAnimation();
}
})
.show();
}