I am trying to test data binding as given in the guide here. I have included this in my build.gradle file (of module app) :
compileSdkVersion \'android-MNC\
You have to be very careful that your POJO class data members should be public if you are not creating the getter setters.
If you have simple POJO without any getter or setter
public class User {
public final String firstName;
public final String lastName;
public User(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
}
If you make getter setter, javaBean style class
public class User {
private final String firstName;
private final String lastName;
public User(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
public String getFirstName() {
return this.firstName;
}
public String getLastName() {
return this.lastName;
}
}