title: Android Data Binding with parameter passing to method
body: <blockquote>
    <p>First, this question is not a case of 'onClick' event parameter passing.</p>
  </blockquote>
  
  <p>I have DateUtil class with one method as below : </p>
  
  <pre><code>public static String formatDate(long date) {
          SimpleDateFormat dateFormat;
          dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH);
          Calendar c = Calendar.getInstance();
  
          dateFormat.setTimeZone(TimeZone.getDefault());
          c.setTimeInMillis(date);
          return dateFormat.format(c.getTimeInMillis());
      }
  </code></pre>
  
  <p>My model CommentEntity has following attributes : </p>
  
  <pre><code> private int id;
   private int productId;
   private String text;
   private Date postedAt;
  </code></pre>
  
  <p>Now in one of layout I'm displaying the Comments. </p>
  
  <pre><code>&lt;layout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
      &lt;data&gt;
          &lt;variable name="comment"
                    type="com.example.entity.CommentEntity"/&gt;
          &lt;variable
          name="dateUtil"
          type="com.example.util.DateUtil"/&gt;
  
      &lt;/data&gt;
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_margin="8dp"
                  android:layout_alignParentRight="true"
                  android:layout_below="@id/item_comment_text"
  
                  //This line gives error for data binding
                  android:text="@{dateUtil.formatDate(comment.postedAt.time)}"/&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p>The error I'm getting is :</p>
  
  <blockquote>
    <p>cannot find method
    formatDate(com.example.util.DateUtil) in class
    long</p>
  </blockquote>
  
  <p>Now for the same if I modify formatDate() method as it will take current time by default, hence removing the parameter passing in data binding, it will work perfectly.</p>
  
  <p>So am I doing something wrong or is it a bug? </p>
  
  <p><em>Please provide solution for problem to pass the parameter to method in data binding.</em></p>