title: Android databinding generalisation issue
body: <p>Not really a question but a hint to people who rely on the Android DataBinding library from Google.</p>
  
  <p>So, I just wanted to adjust way of binding and notifying <code>view-models</code> by keeping them in parent <code>Activity</code> class. Basically, it looks like:</p>
  
  <pre><code>interface AbsViewModel extends BaseObservable {
      final int NO_ID = -1;
      int getVariableId();
      void start();
      void stop();
  }
  
  class abstract AbsBindingActivity&lt;VB extends ViewDataBinding&gt; extends Activity {
      private Map&lt;Integer, AbsViewModel&gt; mViewModels;
      private VB mBinding;
  
      public abstract getLayoutResource();
  
      protected void onCreate(Bundle savedInstanceState) {
         mBinding = DataBindingUtil.setContentView(this, getLayoutResource());
      }
  
      public VB getBinding() {
          return mBinding;
      }
  
      public &lt;VM extends AbsViewModel&gt; VM registerViewModel(VM viewModel) {
          int variableId = viewModel.getVariableId();
          if (variableId != AbsViewModel.NO_ID) {
              mBinding.setVariable(variableId, viewModel);
          }
          mViewModels.put(variableId, viewModel);
          return viewModel;
      }
  
      public  &lt;VM extends AbsViewModel&gt; VM unregisterViewModel(int variableId) {
          mBinding.setVariable(variableId, null);
          return (VM) mViewModels.remove(variableId);
      }
  
      @Override
      protected void onResume() {
          super.onResume();
          start();
      }
  
      @Override
      protected void onPause() {
          super.onPause();
          stop();
      }
  
      @Override
      public void onSaveInstanceState(Bundle outState) {
          for (AbsViewModel viewModel : mViewModels.values()) {
              viewModel.onSaveInstanceState(outState);
          }
      }
  
      private void start() {
          for (AbsViewModel viewModel : mViewModels.values()) {
              viewModel.start();
          }
      }
  
      private void stop() {
          for (AbsViewModel viewModel : mViewModels.values()) {
              viewModel.stop();
          }
      }
  }
  </code></pre>
  
  <p>But for some strange reason, I ended up with BR and DataBindings being not generated. </p>