Blankj / Blankj/AndroidUtilCode

获取Windowmanger对象报错,需要适配最新版本sdk

Aperta
#1,696 0 commenti 0 reazioni 1 assegnatario Rivendicata da @Blankj Vedi su GitHub
bug
Lingua principale
Java
Stelle
33.6k
Fork
10.6k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## 描述 Bug

简洁地描述下 Bug。

- AndroidUtilCode 的版本:1.31.1
- 设备的 Android 版本: Android 11

## 相关代码

Visual services, such as WindowManager, WallpaperService or LayoutInflater should be accessed from Activity or other visual Context. Use an Activity or a Context created with Context#createWindowContext(int, Bundle), which are adjusted to the configuration and visual bounds of an area on screen.

在工具类中任意地方获取windowmanager的都会报错, 比如 ScreenUtils.getScreenHeight()

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.