mirror of https://github.com/M66B/FairEmail.git
This reverts commit eebdff9fda
.
java.lang.AbstractMethodError: abstract method "androidx.lifecycle.ViewModel androidx.lifecycle.ViewModelProvider$Factory.create(kotlin.reflect.KClass, androidx.lifecycle.viewmodel.CreationExtras)"
at androidx.lifecycle.viewmodel.ViewModelProviderImpl.getViewModel$lifecycle_viewmodel_release(ViewModelProviderImpl.kt:69)
at androidx.lifecycle.viewmodel.ViewModelProviderImpl.getViewModel$lifecycle_viewmodel_release$default(ViewModelProviderImpl.kt:47)
at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.android.kt:91)
at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.android.kt:109)
at leakcanary.internal.ViewModelClearedWatcher$Companion.install(ViewModelClearedWatcher.kt:61)
at leakcanary.internal.AndroidXFragmentDestroyWatcher.invoke(AndroidXFragmentDestroyWatcher.kt:66)
at leakcanary.internal.AndroidXFragmentDestroyWatcher.invoke(AndroidXFragmentDestroyWatcher.kt:25)
at leakcanary.FragmentAndViewModelWatcher$lifecycleCallbacks$1.onActivityCreated(FragmentAndViewModelWatcher.kt:59)
at android.app.Application.dispatchActivityCreated(Application.java:189)
at android.app.Activity.onCreate(Activity.java:936)
at androidx.core.app.ComponentActivity.onCreate(ComponentActivity.kt:73)
at androidx.activity.ComponentActivity.onCreate(ComponentActivity.java:359)
at androidx.fragment.app.FragmentActivity.onCreate(FragmentActivity.java:216)
at eu.faircode.email.ActivityBase.onCreate(ActivityBase.java:421)
at eu.faircode.email.ActivityMain.onCreate(ActivityMain.java:200)
at android.app.Activity.performCreate(Activity.java:5937)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
master
parent
07bfd8d6ef
commit
85342c2baf
@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Copyright 2018 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package androidx.lifecycle
|
||||
|
||||
import androidx.annotation.MainThread
|
||||
|
||||
/**
|
||||
* Adds the given [onChanged] lambda as an observer within the lifespan of the given
|
||||
* [owner] and returns a reference to observer.
|
||||
* The events are dispatched on the main thread. If LiveData already has data
|
||||
* set, it will be delivered to the onChanged.
|
||||
*
|
||||
* The observer will only receive events if the owner is in [Lifecycle.State.STARTED]
|
||||
* or [Lifecycle.State.RESUMED] state (active).
|
||||
*
|
||||
* If the owner moves to the [Lifecycle.State.DESTROYED] state, the observer will
|
||||
* automatically be removed.
|
||||
*
|
||||
* When data changes while the [owner] is not active, it will not receive any updates.
|
||||
* If it becomes active again, it will receive the last available data automatically.
|
||||
*
|
||||
* LiveData keeps a strong reference to the observer and the owner as long as the
|
||||
* given LifecycleOwner is not destroyed. When it is destroyed, LiveData removes references to
|
||||
* the observer and the owner.
|
||||
*
|
||||
* If the given owner is already in [Lifecycle.State.DESTROYED] state, LiveData
|
||||
* ignores the call.
|
||||
*/
|
||||
@Deprecated(
|
||||
"This extension method is not required when using Kotlin 1.4. " +
|
||||
"You should remove \"import androidx.lifecycle.observe\""
|
||||
)
|
||||
@MainThread
|
||||
public inline fun <T> LiveData<T>.observe(
|
||||
owner: LifecycleOwner,
|
||||
crossinline onChanged: (T) -> Unit
|
||||
): Observer<T> {
|
||||
val wrappedObserver = Observer<T> { t -> onChanged.invoke(t) }
|
||||
observe(owner, wrappedObserver)
|
||||
return wrappedObserver
|
||||
}
|
Loading…
Reference in new issue