Class UserControllerViewModel

java.lang.Object
androidx.lifecycle.ViewModel
com.example.iconic_raffleevent.UserControllerViewModel

public class UserControllerViewModel extends androidx.lifecycle.ViewModel
ViewModel class for managing an instance of UserController. Ensures that the UserController is created and retained across configuration changes.
  • Constructor Details

    • UserControllerViewModel

      public UserControllerViewModel()
  • Method Details

    • setUserController

      public void setUserController(String userID, android.content.Context context)
      Sets up the UserController if it has not been initialized yet. This method is only called once to avoid re-creating the controller.
      Parameters:
      userID - the unique ID of the user.
      context - the context in which the UserController operates.
    • getUserController

      public UserController getUserController()
      Retrieves the UserController instance.
      Returns:
      the UserController associated with this ViewModel.