I've found the android.app.Application class but am having some troubles getting it to work
~I'm currently getting a classCastException and I don't understand why
My "Global State" object :
This is how I'm trying to set something :
I'm getting a classCast exception on the GlobalState gs = (GlobalState) getApplication();
Any ideas?
Lester Burnham
Rancher
Joined: Oct 14, 2008
Posts: 1337
posted
0
Post the relevant part of the AndroidManifest.xml file where you to tell Android to use the GlobalState class. Seeing the actual exception (full stack trace) would also help.
I've been looking at some tutorials, and they mention to include the "global state" class in the manifest file
I've tried their suggestion of including this, but if I put in an application tag, the manifest file won't be valid, as I already have one application set of tags
This is my manifest
Lester Burnham
Rancher
Joined: Oct 14, 2008
Posts: 1337
posted
0
According to the page you linked to, registering a different Application class does not involve adding another <application> tag, but adding an "android:name" attribute to the <application> tag that's already there.
I faced same situation !
in my case i created Static List<Pojo.Class> myList in Activity #1. &added pojo to List by myList.add(pojoObj);
then retried the Pojos in Activity #2 using Activity1.myList Object ;
Done ! i don't know if this is Optimal solution to the problem !!
neways hope this will help you.