How can I pass a reference to the current activity
<p>I am trying to pass a reference of the current activity to an object but can't seem to find a method that will do this easily. Previously I was able to do this simple passing with the "this" reference of the current context. I then changed my activity from implementing OnClickListener to creating an OnClickListener object so that I could pass it as a parameter. This is when I ran into trouble as I was trying to create the object after I clicked on a button, this means I can no longer pass the activity with "this" because "this" is now a reference of the OnClickListener.</p>

<pre><code>public class MyActivity extends Activity {
    private Object mObject;

    private OnClickListener mListener = new OnClickListener() {
        public void onClick(View v) {
            Object mObject = new Object(this);
        }
    }
}

public class Object {
    private Activity mActivity;
    public Object(Activity a) {
        mActivity = a;
        mActivity.setContentView(R.layout.layout);
    }
}
</code></pre>

<p>Seems like an easy fix but I can't find the answer...</p>

<p>Any help is greatly appreciated.</p>
