title: Realm and Android DataBinding
body: <p>I'm trying to use Realm in my app, but without success. The problem seems to be the fact that i use databinding and Realm in the same application. </p>
  
  <p>The objectif, is let the user to use View to enter some data that i get with databinding, and insert into a Realm Database</p>
  
  <p>I have the following error : </p>
  
  <pre><code>Character is not part of the schema for this Realm
      at io.realm.internal.modules.CompositeMediator.getMediator(CompositeMediator.java:172)
      at io.realm.internal.modules.CompositeMediator.getTableName(CompositeMediator.java:90) 
      at io.realm.RealmSchema.getTable(RealmSchema.java:296)
      at io.realm.Realm.createObjectInternal(Realm.java:817)
      at io.realm.Realm.createObject(Realm.java:801)
  </code></pre>
  
  <p>Here my Character declaration </p>
  
  <pre><code>@RealmClass
  public class Character extends RealmObject implements Serializable
  private String classGame;
  private String name;
  private RealmList&lt;Item&gt; equipments;
  private RealmList&lt;CaracteristicClass&gt; caracteristicClasses;
  private RealmList&lt;Caracteristic&gt; parchemin;
  private RealmList&lt;Caracteristic&gt; caracteristics;
  private RealmList&lt;Sort&gt; spells;
  private int nbCaracteristicPointAvailable;
  private ObservableField&lt;String&gt; nbCaracteristicPointAvailableStringOb;
  
  private int level;
  
  
  
  private String levelString;
  
  public Character() {
  
      initCharacter();
  }
  
  
  private void initCharacter(){
      nbCaracteristicPointAvailableStringOb = new ObservableField&lt;&gt;();
      caracteristics = new RealmList&lt;&gt;();
      parchemin = new RealmList&lt;&gt;();
      spells = new RealmList&lt;&gt;();
       /*
       * Init base caracteristic
       */
      Caracteristic caracteristic = new Caracteristic(TypeCaracteristic.VITALITE.toString(),0,0,11,0);
      caracteristics.add(caracteristic);
      caracteristic = new Caracteristic(TypeCaracteristic.SAGESSE.toString(),0,0,12,0);
      caracteristics.add(caracteristic);
      caracteristic = new Caracteristic(TypeCaracteristic.FORCE.toString(),0,0,13,0);
      caracteristics.add(caracteristic);
      caracteristic = new Caracteristic(TypeCaracteristic.INTELLIGENCE.toString(),0,0,14,0);
      caracteristics.add(caracteristic);
      caracteristic = new Caracteristic(TypeCaracteristic.CHANCE.toString(),0,0,15,0);
      caracteristics.add(caracteristic);
      caracteristic = new Caracteristic(TypeCaracteristic.AGILITE.toString(),0,0,16,0);
      caracteristics.add(caracteristic);
      caracteristic = new Caracteristic(TypeCaracteristic.LEVEL.toString(),1,200,-1,200);
      caracteristics.add(caracteristic);
  
      /*
       *  Parchemin caractéristique
       */
  
      caracteristic = new Caracteristic(TypeCaracteristic.VITALITE.toString(),0,100,11,100);
      parchemin.add(caracteristic);
      caracteristic = new Caracteristic(TypeCaracteristic.SAGESSE.toString(),0,100,12,100);
      parchemin.add(caracteristic);
      caracteristic = new Caracteristic(TypeCaracteristic.FORCE.toString(),0,100,13,100);
      parchemin.add(caracteristic);
      caracteristic = new Caracteristic(TypeCaracteristic.INTELLIGENCE.toString(),0,100,14,100);
      parchemin.add(caracteristic);
      caracteristic = new Caracteristic(TypeCaracteristic.CHANCE.toString(),0,100,15,100);
      parchemin.add(caracteristic);
      caracteristic = new Caracteristic(TypeCaracteristic.AGILITE.toString(),0,100,16,100);
      parchemin.add(caracteristic);
  
  
      caracteristicClasses = new RealmList&lt;&gt;();
      CaracteristicClass caracteristicClass = new CaracteristicClass(0,TypeCaracteristic.VITALITE.toString(),1);
      caracteristicClasses.add(caracteristicClass);
      caracteristicClass = new CaracteristicClass(0,TypeCaracteristic.SAGESSE.toString(),3);
      caracteristicClasses.add(caracteristicClass);
      caracteristicClass = new CaracteristicClass(0,TypeCaracteristic.AGILITE.toString(),1);
      caracteristicClasses.add(caracteristicClass);
      caracteristicClass = new CaracteristicClass(0,TypeCaracteristic.CHANCE.toString(),1);
      caracteristicClasses.add(caracteristicClass);
      caracteristicClass = new CaracteristicClass(0,TypeCaracteristic.FORCE.toString(),1);
      caracteristicClasses.add(caracteristicClass);
      caracteristicClass = new CaracteristicClass(0,TypeCaracteristic.INTELLIGENCE.toString(),1);
      caracteristicClasses.add(caracteristicClass);
  
  }
  public Character(final String name, final int level ){
      initCharacter();
  
  }
  
  public String getClassGame() {
      return classGame;
  }
  public void setClassGame(String classGame) {
      this.classGame = classGame;
  }
  
  public String getName(){
      return name;
  }
  
  public void setName(String name) {
      this.name = name;
  }
  
  public RealmList&lt;Item&gt; getEquipments() {
      return equipments;
  }
  
  public void setEquipments(RealmList&lt;Item&gt; equipments) {
      this.equipments = equipments;
  }
  
  public RealmList&lt;Caracteristic&gt; getParchemin() {
      return parchemin;
  }
  
  public void setParchemin(RealmList&lt;Caracteristic&gt; parchemin) {
      this.parchemin = parchemin;
  }
  
  public RealmList&lt;Caracteristic&gt; getCaracteristics() {
      return caracteristics;
  }
  
  public void setCaracteristics(RealmList&lt;Caracteristic&gt; caracteristics) {
      this.caracteristics = caracteristics;
  }
  
  public RealmList&lt;Sort&gt; getSpells() {
      return spells;
  }
  
  public void setSpells(RealmList&lt;Sort&gt; spells) {
      this.spells = spells;
  }
  
  public int getLevel() {
      return level;
  }
  
  public String getLevelString() {
      return levelString;
  }
  
  public ObservableField&lt;String&gt; getNbCaracteristicPointAvailableStringOb() {
      return nbCaracteristicPointAvailableStringOb;
  }
  
  public void setNbCaracteristicPointAvailableStringOb(String nbCaracteristicPointAvailableStringOb) {
      this.nbCaracteristicPointAvailableStringOb.set(nbCaracteristicPointAvailableStringOb);
      this.nbCaracteristicPointAvailableStringOb.notifyPropertyChanged(BR.character);
  }
  
  public void setLevelString(String levelString) {
      this.levelString = levelString;
      try{
          if(!this.levelString.equals("")){
              this.level = Integer.parseInt(this.levelString);
              if(level&gt;0 &amp;&amp; level&lt;=Constants.MAX_LEVEL){
                  nbCaracteristicPointAvailable = (level -1) * 5;
                  this.setNbCaracteristicPointAvailableStringOb(String.valueOf(nbCaracteristicPointAvailable));
              }
          }
      }catch (NumberFormatException ex){
          Log.i("Character","emptyString or Invalid");
      }
  }
  </code></pre>
  
  <p>Here my module build.gradle </p>
  
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'realm-android'
  apply plugin: 'com.jakewharton.butterknife'
  
  android {
     compileSdkVersion 25
     buildToolsVersion "25.0.1"
     defaultConfig {
         applicationId "*******"
         minSdkVersion 15
         targetSdkVersion 25
         versionCode 1
         versionName "0.0.0"
         testInstrumentationRunner    "android.support.test.runner.AndroidJUnitRunner"
     }
     buildTypes {
         release {
             minifyEnabled false
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
         }
     }
     dataBinding{
         enabled = true;
     }
  }
  
  dependencies {
     compile fileTree(dir: 'libs', include: ['*.jar'])
     androidTestCompile('com.android.support.test.espresso:espresso-  core:2.2.2', {
      exclude group: 'com.android.support', module: 'support-annotations'
  })
  compile 'com.android.support:appcompat-v7:25.0.1'
  compile 'com.android.support:design:25.0.1'
  compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
  compile 'com.android.support:appcompat-v7:25.0.1'
  compile 'com.android.support:recyclerview-v7:25.0.1'
  compile 'com.android.support:cardview-v7:25.0.1'
  compile 'com.android.support:support-v4:25.0.1'
  compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.3'
  compile 'com.github.amlcurran.showcaseview:library:5.0.0'
  compile 'org.jsoup:jsoup:1.7.3'
  compile 'com.android.support:design:25.0.1'
  compile 'com.google.android.gms:play-services-appindexing:9.8.0'
  compile 'com.jakewharton:butterknife:8.4.0'
  compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
  compile 'org.apache.commons:commons-collections4:4.1'
  compile 'org.apache.commons:commons-lang3:3.4'
  annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
  testCompile 'junit:junit:4.12'
  compile project(path: ':androidhttprequestlibrairy')
  </code></pre>
  
  <p>}</p>
  
  <p>Here my project build.gradle</p>
  
  <pre><code>buildscript {
  repositories {
      jcenter()
  }
  dependencies {
      classpath 'com.android.tools.build:gradle:2.3.0-alpha1'
      classpath "io.realm:realm-gradle-plugin:2.2.1"
      classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
      // NOTE: Do not place your application dependencies here; they belong
      // in the individual module build.gradle files
      }
    }
    allprojects {
        repositories {
         jcenter()
       }
    }
  
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
  </code></pre>
  
  <p>Here my activity that use Realm and DataBinding</p>
  
  <pre><code>final ActivityCreateBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_create);
      ButterKnife.bind(binding.getRoot());
      Realm.init(getApplicationContext());
      RealmConfiguration config = new RealmConfiguration.Builder().build();
      realm = Realm.getInstance(config);
      realm.beginTransaction();
      character = realm.createObject(Character.class);
      binding.setCharacter(character);
  </code></pre>
  
  <p>And some line of code below in a listener i use </p>
  
  <pre><code>  realm.commitTransaction();
  </code></pre>
  
  <p>I don't understant what is the problem ... </p>
  
  <p>Sincerely,</p>