mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-25 03:07:39 +00:00
24505cd111
The adapter will cache a LayoutInflater which refers the current activity, and the ViewModel object will keep alive until activity finished. After activity recreates (e.g. split-screen), it will use the cached LayoutInflater which refers a destroyed activity and crashes. This also is a memory-leak, according to Google's official document, ViewModel shouldn't refer activity. See https://developer.android.com/topic/libraries/architecture/viewmodel Fix topjohnwu#5413