0

Hello i want to convert ebookdroid to a library. When I mark it as library i could use its classes in my project. However in ebookdroid when app is loaded Ebookdroid class which extends Aplication is called. This class init app Settings. So is it possible to call this init class from my project if ebookdroid is Library ?

When I try to do this:

EBookDroidApp app = (EBookDroidApp)getApplication();
app.init();

I get:

java.lang.ClassCastException: android.app.Application
unholysampler
  • 17,141
  • 7
  • 47
  • 64
Streetboy
  • 4,351
  • 12
  • 56
  • 101

1 Answers1

0

You need to specify the Application class in AndroidManifest.xml. This way, when the application is launched, Android will know what class to use. By default, Android will always use Application, which can not be cast to EBookDroidApp.

See this answer for an example.

Community
  • 1
  • 1
unholysampler
  • 17,141
  • 7
  • 47
  • 64