How to pass an object to an Activity in a library?
<p>I have a library and application that uses it. I need to change this code so that a user of   library could pass its own implementation of IDialog to LibActivity (not modifying a source code of a library).
What is the best way to pass an object to an activity in library ?</p>

<p>library:</p>

<pre class="lang-java prettyprint-override"><code>class LibActivity extends Activity {
private IDialog dialog = new Dialog ();
...
}
</code></pre>

<pre class="lang-java prettyprint-override"><code>interface IDialog {...} 
</code></pre>

<pre class="lang-java prettyprint-override"><code>class Dialog implements IDialog {...}
</code></pre>

<p>application:</p>

<pre class="lang-java prettyprint-override"><code>class TestActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = new Intent (this,LibActivity.class);
startActivity (intent);
...
}
}
</code></pre>
