Is that a right way of using interface callback?
<p>I read <a href="https://stackoverflow.com/questions/18054720/what-is-callback-in-android">this</a> and <a href="https://stackoverflow.com/questions/8292712/android-custom-event-listener">this</a> and found out that in class <code>B</code> I need to save a reference to class <code>A</code> and when something happens in class <code>B</code> we execute a method defined by an interface that class <code>A</code> implements. Well somehow I understood it. I use interfaces in a bit different way to call a callback:</p>

<pre><code>interface IHelper {
    void onActionDone ();
    void onActionFailed ();
}            

public class Helper implements IHelper {

    public Helper (Param param) {
        // here we do what Helper class intended to do
        // ...
        // now call the any of callbacks
        if(everything == OK) {
            onActionDone();
        } else {
            onActionFailed();
        }
    }

    @Override
    public void onActionDone() {}

    @Override
    public void onActionFailed() {}
}

public class MainClass () {
    new Helper(message) {
        public void onActionDone () {
            // here we can do anything we want after Helper will done its functions
        }
        public void onActionFailed () {
            // or not done
        }
    }
}
</code></pre>

<p>I find this way is more readable and easier to understand but not sure if this is a bad practice or not. So may I feel free to go this way further?</p>