title: Update String Value Using Live Data
body: <p>I am Implementing the Data Binding with Live Data Architecture . I done all the stuff but I am unable to find where i have to update the response value in fragment.
  I made a button and on button click I am able to send the data to server and get the response . But My problem is How the msg value or Success value update in fragment. My observer not called when value is update . Is there anything i am doing wrong implementation . Thanks in advance.</p>
  
  <p><strong>My Fragment</strong></p>
  
  <pre><code>  **Oncreate Method**
              {        signUpViewModel=ViewModelProviders.of(getActivity()).get(SignUpViewModel.class);
                  observeViewModel(signUpViewModel);
                return view;
              }
  
  //my observe class
              private void observeViewModel(SignUpViewModel signinViewModel) {
                      if (signinViewModel.getmessage() != null) {
                          signinViewModel.getmessage().observe(this, new Observer&lt;String&gt;() {
                              @Override
                              public void onChanged(@Nullable String msg) {
                                  if (msg != null) {
                                      Toast.makeText(getActivity(), msg, Toast.LENGTH_SHORT).show();
                                  }
                              }
                          });
                      }
                  }
  
  //button clicked     
              public void onSignUpClicked(View view)
              {   
       signUpViewModel.registerUser(userFName, userLName, userEmail,userPassword);
                      }
  </code></pre>
  
  <p><strong>SignUpViewModel.class</strong></p>
  
  <pre><code>public class SignUpViewModel extends ViewModel{
      private LoginFragmentRepository loginFragmentRepository;
      private LiveData&lt;String&gt; sucessMsg;
      String signUpMsg;
  
      public  void registerUser(String userFName, String userLName, String userEmail, String userPassword) {
         loginFragmentRepository=new LoginFragmentRepository();
          sucessMsg= loginFragmentRepository.registerUser( userFName,  userLName,  userEmail,  userPassword);
      }
  
      /**
       * get signup msg
       * @return
       */
      public LiveData&lt;String&gt; getmessage() {
          return sucessMsg;
      }
  </code></pre>
  
  <p><strong>LoginFragmentRepository</strong> </p>
  
  <pre><code>{
      private ApiInterface apiInterface;
      private UserDao userDao;
  public LiveData&lt;String&gt; registerUser(String userFName, String userLName, String userEmail, String userPassword) {
          apiInterface = RestApi.getRetroInstance().create(ApiInterface.class);
           final MutableLiveData&lt;String&gt; msg = new MutableLiveData&lt;&gt;();
          Call&lt;SignUpModel&gt; req = apiInterface.registerUser(userFName,userLName,userEmail,userPassword);
          req.enqueue(new Callback&lt;SignUpModel&gt;() {
              @Override
              public void onResponse(Call&lt;SignUpModel&gt; call, Response&lt;SignUpModel&gt; response) {
                  if (response.isSuccessful()) {
                    //update this value in fragment
                      msg.postValue(response.body().getData());
                      //getReceipesListDataResponseMutableLiveData.setValue(NetworkResponse.success(receipes));
                  } else {
                      msg.postValue("Please check your network connection");
                  }
              }
  
              @Override
              public void onFailure(Call&lt;SignUpModel&gt; call, Throwable t) {
                  msg.postValue("Please check your network connection");
              }
          });
          return msg;
      }
  }
  </code></pre>