I have implemented DataBinding with MVVM pattern, here is my ViewModel
class.
public class MainViewModel extends BaseObservable {
private String data, data1;
@Bindable
public String getData1() {
return data1;
}
public void setData1(String data1) {
this.data1 = data1;
}
@Bindable
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
notifyPropertyChanged(BR.data);
}
}
now the problem is i can see BR.data
there but not able to get BR.data1
, how to use notifyPropertyChanged()
for data1
variable.
I have tried to clean the project, also tried with rebuild it but didn't help me.
Here is my build.gradle
file
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
dataBinding {
enabled = true
}
defaultConfig {
...
...
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
}