title: Android: Kotlin: custom webView - cannot be invoked as a function. The function 'invoke()' is not found
body: <p>I has one activity (<strong>ContactActivity.kt</strong>) that contain only one webView component. Activity write on Kotlin. </p>
  
  <p>I want to replace webView with my custom webView (<strong>ObservableWebView.java</strong>).</p>
  
  <p>So here code (<strong>MyActivity.kt</strong>):</p>
  
  <pre><code>class ContactActivity : AppCompatActivity() {
  
          @SuppressLint("NewApi")
          override fun onCreate(savedInstanceState: Bundle?) {
              verticalLayout {
       val observableWebView = object : ObservableWebView(MainApp.getAppContext())
              observableWebView { // error here
                      setOnLongClickListener(object : View.OnLongClickListener {
                          override fun onLongClick(v: View): Boolean {
                              return true
                          }
                      })
                  }
              }
         }
      }
  </code></pre>
  
  <p>Also I has custom webView - ObservableWebView.java:</p>
  
  <pre><code>public class ObservableWebView extends WebView {
      private OnScrollChangedCallback mOnScrollChangedCallback;
  
      public ObservableWebView(final Context context) {
          super(context);
      }
  
      public ObservableWebView(final Context context, final AttributeSet attrs) {
          super(context, attrs);
      }
  
      public ObservableWebView(final Context context, final AttributeSet attrs, final int defStyle) {
          super(context, attrs, defStyle);
      }
  
      @Override
      protected void onScrollChanged(final int l, final int t, final int oldl, final int oldt) {
          super.onScrollChanged(l, t, oldl, oldt);
          if (mOnScrollChangedCallback != null) mOnScrollChangedCallback.onScroll(l, t);
      }
  
      public OnScrollChangedCallback getOnScrollChangedCallback() {
          return mOnScrollChangedCallback;
      }
  
      public void setOnScrollChangedCallback(final OnScrollChangedCallback onScrollChangedCallback) {
          mOnScrollChangedCallback = onScrollChangedCallback;
      }
  
      /**
       * Impliment in the activity/fragment/view that you want to listen to the webview
       */
      public static interface OnScrollChangedCallback {
          public void onScroll(int l, int t);
      }
  }
  </code></pre>
  
  <p>But I get compile error in <strong>MyActivity.kt</strong>:</p>
  
  <pre><code>Error:(145, 13) Expression 'observableWebView' of type '&lt;no name provided&gt;' cannot be invoked as a function. The function 'invoke()' is not found
  </code></pre>