Roman
Roman

Reputation: 908

Subclassing Android Application in Intellij IDEA?

I have custom Application class in my Android project that is properly described in manifest and actually works.

But one small question: do I really need to call in this way methods implemented in my App class:

((App) getApplication()).callSomeMethod();

because IDEA doesn't allow me to run application:

cannot find symbol method callSomeMethod()

or I can avoid it?

Thanks in advance!

Upvotes: 1

Views: 139

Answers (1)

wsanville
wsanville

Reputation: 37516

You must typecast the result from getApplication() to your subclass. This isn't anything Android specific, but rather, how the Java language works.

Upvotes: 2

Related Questions