Register Listener in constructor of subclass
<p>I need to register a <code>Listener</code> in my subclass on an inherited <code>final</code> field (<code>mCursorLoader</code>). I need to do this in the <code>constructor</code> of my subclass. <strong>Preferably without changing the fields to <code>non-final</code> or doing any <code>unRegistering</code> in the subclass.</strong></p>

<p>The problem is that my parent class is registering the <code>Listener</code> from its implementation in its constructor. And i need a way to either prevent it from registering that <code>Listener</code> and then register the subclasses <code>Listener</code> or unRegister the parent classes <code>Listener</code> and then register the subclasses <code>Listener</code>.</p>

<p>Having a hard time explaining, so if it needs more clarification, please let me know.</p>

<pre><code>public abstract class A&lt;T&gt; extends AsyncTaskLoader&lt;List&lt;T&gt;&gt; {

        protected final Listener mListener = new Listener();
        protected final CursorLoader mCursorLoader;
        protected final String mId;

        public A(Context context, String mId) {

                super(context);
                this.mCursorLoader = new CursorLoader(context);
                this.mCursorLoader.registerListener(0, mListener);
                this.mId = mId;

        }

        public class Listener implements OnLoadCompleteListener&lt;Cursor&gt; {

                public void onLoadComplete(final Loader&lt;Cursor&gt; loader, final Cursor cursor) {

                }
        }
}

public abstract class B&lt;T&gt; extends A&lt;T&gt; {

        protected B(Context context, String mId) {

                super(context, mId);

        }

        public class Listener implements OnLoadCompleteListener&lt;Cursor&gt; {

                public void onLoadComplete(final Loader&lt;Cursor&gt; loader, final Cursor cursor) {

                }
        }
}
</code></pre>
