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