12345678910111213141516171819 |
- package com.example.myapplication.ui.slideshow;
- import androidx.lifecycle.LiveData;
- import androidx.lifecycle.MutableLiveData;
- import androidx.lifecycle.ViewModel;
- public class SlideshowViewModel extends ViewModel {
- private MutableLiveData<String> mText;
- public SlideshowViewModel() {
- mText = new MutableLiveData<>();
- mText.setValue("This is slideshow fragment");
- }
- public LiveData<String> getText() {
- return mText;
- }
- }
|