Why 'this' can be used as the argument here in Java?
<pre><code>public class Activity01 extends Activity implements OnClickListener,
        ViewFactory {
        ...
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);

            LinearLayout main_view = new LinearLayout(this);
            m_Switcher = new ImageSwitcher(this);
            main_view.addView(m_Switcher);
            m_Switcher.setId(SWITCHER_ID);
            m_Switcher.setFactory(this);
            m_Switcher.setOnClickListener(this);
            setContentView(main_view);
            ...
        }

        public void onClick(View v) {
            ...
        }
    }
</code></pre>

<p>Above code is from an Android project, and below function's argument is set as 'this', why?</p>

<pre><code>m_Switcher.setOnClickListener(this);
</code></pre>

<p>According to the javadoc, here should be like below:</p>

<pre><code>public void setOnClickListener (View.OnClickListener l)
</code></pre>

<p>That means the argument should be this kind: <code>View.OnClickListener</code></p>

<p>So why 'this' can be there? Thanks!</p>

<p>Note: According to the answers, I gave a more complete code above.</p>
