"Calling" UI activity method from a class
<p>I have an Activity which mainly handles the UI, and I do most of the rest from another class (not a service). One of the things I do from that class is playing audio. What I need to do is tell my Activity when the audio finished playing (OnCompletionListener).</p>

<pre><code>public class MyClass implements OnCompletionListener {
          private MyActivity activity = new MyActivity();
public MyClass(){
}
 ...........
 ...........
 ...........
@Override
    public void onCompletion(MediaPlayer mp) {
        activity.onComplete();

    }

}
</code></pre>

<p>This is wrong because "Cannot make a static reference to the non-static method onComplete() from the type MyActivity.</p>

<p>I'm pretty sure I'm using Java wrong, but I cant figure out how to call onComplete from the class. (changing onComplete to static isn't posible).</p>

<p>EDIT:
added a constructor to MyActivity:</p>

<pre><code>public MyActivity(){

    }
</code></pre>

<p>and created an instance of MyActivity, activity (see the edited code above), passed it to the method, but when I do <code>activity.onComplete();</code> it stops unexpectedly. (I dont know why my logcat isnt working, I'll post back when I get it to work)</p>
