title: Singleton-like pattern for cases when hiding constructor is not possible?
body: <p>I know <em>Singleton-pattern</em>.</p>
  <p>I'd need to achieve two-way communication between two class instances, but instantiation is not done by me (but by some 3rd party library).</p>
  <p>This 3rd party library has also a requirement that a public default constructor has to be available in this form:</p>
  <pre><code>public MyClassA(Context ctx);
  </code></pre>
  <p>This 3rd party library will initialize two of my classses <code>MyClassA</code> and <code>MyClassB</code>.</p>
  <p>What's the most efficient/recommended technique to communicate (call each other's functions) between them?</p>
  <p>So, 3rd party library instantiates <code>MyClassA</code> with its constructor shown above. It also instantiates <code>MyClassB</code> (which has the very same signature as <code>MyClassA</code>).</p>
  <p>Then upon some events by this 3rd party (which calls <code>MyClassA</code>'s implemented method named <code>onEvent0</code>) I need to call <code>MyClassB</code>'s instance's <code>doSomeAction</code> function:</p>
  <pre><code>3rdpartylib::notify -&gt; myclassa::onEvent0() -&gt; myclassb::doSomeAction
  </code></pre>
  <p>I know I could store an instance when the 3rd party instantiates my classes, but is it the recommended way, if we take into account the Android platform which has some nice <code>Handler</code>, and <code>ServiceConnection</code> paradigms?</p>