android-architecture-lifecycle Questions
7
Solved
I tried to add a unit test for my function which supports architecture components lifecycle event. To support lifecycle event, I added the @OnLifecycleEvent annotation for my function which I want ...
Pelagian asked 29/6, 2018 at 9:52
7
Solved
I have a need to transform one type of data, returned by a LiveData object, into another form on a background thread to prevent UI lag.
In my specific case, I have:
MyDBRow objects (POJOs consis...
Haun asked 19/11, 2017 at 7:22
4
Solved
I am using Bottom Navigation with Navigation Architecture Component. When the user navigates from one item to another(via Bottom navigation) and back again view model call repository function to fe...
Lissome asked 30/5, 2019 at 12:43
3
I am trying to test a simple ViewModel with Robolectric.
Here's my ViewModel
GreetingsViewModel.kt
@FlowPreview
@ExperimentalCoroutinesApi
class GreetingsViewModel : ViewModel() {
private val...
Caryloncaryn asked 27/4, 2020 at 15:57
2
Solved
I have a LiveData object that depends on another LiveData. As I understand, Transformations.switchMap should allow to chain them. But switchMap handler is triggered only once and it doesn't react o...
Bladderwort asked 21/11, 2017 at 19:30
2
Solved
I'm adopting MVVM to my Android apps recently. In order to solve the problems underlying with the lifecycle of an app, Google had released LiveData.
The usage of LiveData has different scenarios,...
Maes asked 13/10, 2018 at 2:25
1
Solved
My app is crashing on launch with a LinkageError when creating a view model using lazy{}. The crash only happens when:
minifyEnabled is set to true in build.gradle, AND
I use ver. 2.1.0 of life...
androidandroid-architecture-componentsandroid-jetpackandroid-viewmodelandroid-architecture-lifecycle
Glochidiate asked 18/9, 2019 at 14:44
6
I have a ViewModel named SharedViewModel:
public class SharedViewModel<T> extends ViewModel {
private final MutableLiveData<T> selected = new MutableLiveData<>();
public voi...
Realize asked 19/6, 2017 at 22:51
3
I am using Android Support Library 26.1.0. These are the dependencies in the app module:
implementation "android.arch.lifecycle:runtime:1.0.0"
implementation "android.arch.lifecycle:...
Favianus asked 28/9, 2017 at 8:58
3
Solved
I have read the document about Life Cycle and Live Data in the android official documentation. I know the class implemented LifeCycleObserver and make the location listener closed or open automatic...
Autochthonous asked 25/6, 2017 at 17:8
2
Solved
This is a very simple question:
Background
I'm using the relatively new Lifecycle class (part of the android architecture components libraries) to handle some events of the Activity/Fragmen...
Orlando asked 16/8, 2018 at 7:49
2
Solved
Since recently my app started to contain strange error messages in the pre-launch reports (automatically generated after upload to the Play store).
These reports contain exceptions such as the fol...
Brummett asked 3/11, 2017 at 15:53
0
I'm working on an inventory application based on Architecture components (ViewModel/Room/Livedata) and RecyclerView. The app based on the practise that Google recommends in Developer training book....
Lemay asked 30/7, 2018 at 15:8
1
Solved
I am using architecture component view model's LiveData to populate recycler view and want to add a searchview filter but couldn't find any solution.
I tried to use filterable interface in the adap...
Hiltonhilum asked 1/6, 2018 at 8:6
2
Solved
Recently I updated android.arch support library version in gradle file
// ViewModel and LiveData
implementation "android.arch.lifecycle:extensions:1.1.1"
// alternatively, just ViewModel
imp...
Ribwort asked 1/4, 2018 at 8:37
1
Solved
I currently use LifecycleObserver for notifying about events such as onStart of my view. This is great for components as presenters or handlers, such as FacebookLoginHandler that needs to register ...
Hardej asked 6/1, 2018 at 10:27
3
Solved
My question is related to ViewModel second time returns null wherein I am not getting callback inobserve function if I make a repeated call to server. Following is the code I am using -
@Singleton...
androidandroid-architecture-componentsandroid-livedataandroid-architecture-lifecycleandroid-viewmodel
Ink asked 28/11, 2017 at 7:7
4
Solved
I've started learning architecture components, but can't find one thing.
LifecycleFragment just creates a new LifecycleRegistry object, which does not start observing the fragment's lifecycle.
I ...
Ouachita asked 16/6, 2017 at 17:28
2
Solved
I had an Activity that extended AppCompactActivity, and in onCreate method I setted the Toolbar using setSupportActionBar method in the usual way:
public class StepMasterActivity extends AppCompat...
androidandroid-activityactivity-lifecycleandroid-architecture-componentsandroid-architecture-lifecycle
Waynant asked 20/6, 2017 at 23:10
1
© 2022 - 2024 — McMap. All rights reserved.