title: How to override view binding adapter methods in derived classes in android?
body: <p>I am accessing the same fragment layout through the abstract class for two different derived class as mentioned below, Based on the derived fragment the value will get updated on the views.
  Now My problem is to access override method from static binding adapter method as mentioned below. What is the best architectural approach to handle this situation?</p>
  <p>My XML will be like (fragmentLayout.xml)</p>
  <pre><code>&lt;layout&gt;
      &lt;data&gt;
          &lt;variable
              name=&quot;viewModel&quot;
              type=&quot;MyViewModel&quot; /&gt;
      &lt;/data&gt;
      &lt;ConstraintLayout&gt;
          &lt;Button
               android:id=&quot;@+id/button&quot;
               style=&quot;@style/buttonStyle&quot;       
               app:name=&quot;@{viewModel.buttonName}&quot;/&gt;
      &lt;/ConstraintLayout&gt;
  &lt;/layout&gt;
  </code></pre>
  <p>My AbstractFragment class will be like</p>
  <pre><code>public abstract class AbstractFragment extends Fragment {
      @Nullable
      @Override
      public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
                               @Nullable Bundle savedInstanceState) {
          FragmentLayoutBinding fragmentLayoutBinding = FragmentLayoutBinding.inflate(inflater);
          fragmentLayoutBinding.setLifecycleOwner(this);
          fragmentLayoutBinding.setfragment(this);
          MyViewModel myViewModel = new ViewModelProvider 
                  (ContextProvider.getFragmentActivity(),this).get(&quot;model&quot;, MyViewModel.class);
          fragmentLayoutBinding.setViewModel(myViewModel);
          return fragmentLayoutBinding.getRoot();
      }
  
      @BindingAdapter(value = {&quot;name&quot;})
      public static void buttonBinding(@NonNull Button button, String name) {
         // update(button, name); =&gt; how to access the abstract method from here
      }
  
      protected abstract void update(Button button, String name);
  }
  </code></pre>
  <p>And MyDerivedFragments Classes will be like</p>
  <pre><code>protected class MyDerivedFragmentOne extends AbstractFragment {
      @Override
      protected void update(Button button, String name) {
          button.setText(name + &quot;DerviedOne&quot;);
      }
  }
  protected class MyDerivedFragmentTwo extends AbstractFragment {
      @Override
      protected void update(Button button, String name) {
          button.setText(name + &quot;DerviedTwo&quot;);
      }
  }
  </code></pre>
  <p>Kindly help me out!</p>