Class extending Application in Android project library?
<p>I have a project (in Eclipse) which I've turned into an Android Project Library so as to re-use some of the code in another similar project.  I think I've shot myself in the foot however as I'm getting the error:</p>

<pre><code>Unable to start activity ComponentInfo{com.test.scroller1/com.lib.scrolltest.ScrollTestActivity}: java.lang.ClassCastException: android.app.Application cannot be cast to com.lib.scrolltest.resAppVars
</code></pre>

<p>com.lib.scrolltest is my Project Library which instantiates a class extending Application (resAppVars). In the onCreate() method I call:</p>

<pre><code>mRav = (resAppVars) getApplicationContext ();
</code></pre>

<p>This way, I can use methods in the mRav object which would otherwise be a lot of duplicated code in other classes (such as passing a query to a generic select statement which returns an ArrayList of results).</p>

<p>What's the problem here? It seems I've hit a limitation in the way I've implemented the Application class. </p>
