Blankj / Blankj/AndroidUtilCode

ToastUtils内存泄漏

Abierto
#1,690 2 comentarios 0 reacciones 1 asignado Reclamado por @Blankj Ver en GitHub
bug
Lenguaje dominante
Java
Estrellas
33.6k
Forks
10.6k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

## 描述
ToastUtils内存泄漏
## 版本
api "com.blankj:utilcode:1.30.6"

## 代码示例
```java
// 放弃xxx.show(view); 方式调用 内存泄漏
public void showReportRemoteGenerateToast() {
FrameLayout frameLayout = new FrameLayout(getContext());
TextView textView = new TextView(getContext());
rameLayout.addView(textView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
frameLayout.setBackgroundResource(R.drawable.argclib_map_shape_black_r6_rect);
frameLayout.setAlpha(0.7f);
textView.setText("反馈成功,我们会尽快处理");
textView.setTextColor(Color.WHITE);
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15);
textView.setGravity(Gravity.CENTER);
textView.setWidth(SizeUtils.dp2px(240));
textView.setHeight(SizeUtils.dp2px(58));
ToastUtils.make().setGravity(Gravity.CENTER, -1, -1 * SizeUtils.dp2px(22)).show(frameLayout);
}
```

## 截图
![image](https://user-images.githubusercontent.com/5853418/186049961-5b71807b-cb41-4183-bbc0-abca9444cd9f.png)

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.