Call class function in BroadcastReceiver onReceive function
<p><br/>I have a service with a <code>BroadcastReceiver</code>.<br/>How can I call a function in the service class from the <code>onReceive</code> function of the <code>BroadcastReceiver</code>?<br/>And if I can't, what can I do?<br/>Here is some code :</p>

<pre><code>public class MyService extends Service {
    private BroadcastReceiver broadcastReceiver;

    @Override
    public IBinder onBind(Intent arg0) {
        return null;
    }

    @Override
    public void onCreate() {
        broadcastReceiver = new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {
                ... // How to call myFunction() here?
            }
        };
        ... // intentFilter, registerReceiver, etc...
    }

    private void myFunction() {
        ... // do something
    }
}
</code></pre>
