title: Error when attempting to use the data binding provided context variable with BaseObservable
body: <p>Per <a href="https://stackoverflow.com/questions/32374483/android-databinding-where-to-get-context#comment56066207_32385583">this comment</a> and the <a href="https://developer.android.com/topic/libraries/data-binding/index.html#variables" rel="noreferrer">Android Data Binding tutorial</a> I should have a <code>context</code> variable available when data binding:</p>
  
  <blockquote>
    <p>A special variable named context is generated for use in binding expressions as needed. The value for context is the Context from the root View's getContext(). The context variable will be overridden by an explicit variable declaration with that name.</p>
  </blockquote>
  
  <p>I'm using a class extending <code>BaseObservable</code> to set my data, but no matter how I try to bring in the <code>context</code> variable in my <code>@Bindable</code> method I get the compile time error:</p>
  
  <blockquote>
    <p>java.lang.RuntimeException: failure, see logs for details.
      @Bindable associated with method must follow JavaBeans convention getStyledName(android.content.Context)</p>
  </blockquote>
  
  <p>As far as I can tell, I am following JavaBeans conventions. I've tracked the error down to <a href="https://android.googlesource.com/platform/tools/adt/idea/+/f60d841/android/src/com/android/tools/idea/databinding/BrUtil.java#59" rel="noreferrer">this line in BrUtil</a> but that didn't give me much help either.</p>
  
  <p>I've tried changing my method and parameter names, I've tried adding in a <code>&lt;variable&gt;</code> for the <code>context</code> and a <code>&lt;import&gt;</code> for <code>android.content.Context</code>, but none of that made any difference. My <code>User.java</code> below has two <code>@Bindable</code> methods, the bare <code>getName()</code> works fine but the one that tries to use the <code>context</code> variable doesn't, so I don't think it's an issue with the rest of my data binding setup either.</p>
  
  <p>Relevant code:</p>
  
  <p><code>activity_main.xml</code>: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          xmlns:tools="http://schemas.android.com/tools"&gt;
  
      &lt;data&gt;
          &lt;variable name="user" type="com.kasra.androidsandbox.User" /&gt;
      &lt;/data&gt;
  
      &lt;LinearLayout
          android:id="@+id/main_layout"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical"&gt;
  
          &lt;android.support.v7.widget.Toolbar
              android:id="@+id/main_toolbar"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:background="?attr/colorPrimary"
              android:minHeight="?attr/actionBarSize"
              app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
              app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /&gt;
  
          &lt;TextView
              android:id="@+id/main_textview"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:gravity="center"
              android:text="@{user.getStyledName(context)}" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p><code>User.java</code>:</p>
  
  <pre><code>public class User extends BaseObservable {
      private String name;
  
      public User(String name) {
          this.name = name;
      }
  
      @Bindable
      public String getName() {
          return this.name;
      }
  
      @Bindable
      public CharSequence getStyledName(Context ctx) {
          int color = ctx.getResources().getColor(R.color.branded_pink);
  
          Spannable textSpan = new SpannableString(name);
          textSpan.setSpan(new ForegroundColorSpan(color), 0, textSpan.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
  
          return textSpan;
      }
  
  }
  </code></pre>
  
  <p><code>MainActivity.java</code>:</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
      User user = new User("Kasra");
      binding.setUser(user);
  
      Toolbar toolbar = (Toolbar) findViewById(R.id.main_toolbar);
      setSupportActionBar(toolbar);
  }
  </code></pre>