Back to project page YOW2014-Android-MVVM.
The source code is released under:
MIT License
If you think the Android project YOW2014-Android-MVVM listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.adilmughal.demo.yow.mvvm.searchd.viewmodel; // w w w.jav a 2 s .c o m import org.robobinding.presentationmodel.AbstractPresentationModel; import android.os.Handler; import android.os.Looper; public class ViewModelBase extends AbstractPresentationModel { protected void notifyPropertyChanged(final String propertyName) { if (Looper.myLooper() == Looper.getMainLooper()) { super.firePropertyChange(propertyName); } else { // Dispatch/post to UI thread new Handler(Looper.getMainLooper()).post(new Runnable() { @Override public void run() { firePropertyChange(propertyName); } }); } } }