https://kotlinlang.org logo
#android
Title
# android
y

YMobile

02/09/2018, 4:36 PM
I give App class name to android:name, but it is not working
b

bloder

02/09/2018, 4:39 PM
What error shows to you?
Do you have a print of this error or something like that?
y

YMobile

02/09/2018, 4:42 PM
Class name is gray color
So it shows "Class 'DemoApp' is never used" if I take the mouse pointer over it
b

bloder

02/09/2018, 5:06 PM
But when you try to run, it's not calling that application onCreate?
y

YMobile

02/09/2018, 5:30 PM
Yes
It is not called
b

bloder

02/09/2018, 5:40 PM
Ohh that's weird, are you declared all your activities inside application tag in manifest?
and maybe it can be a problem with a lot of external dependencies in your project
j

johnsinguay

02/10/2018, 1:41 AM
Tried to replicate your issue, it does as you say. But seems normal to me, it'll be out of the gray when you actually use it for running application level functions written in the DemoApp class. :)
v

voghdev

02/12/2018, 11:20 AM
have you tried the full qualified class name? like
.global.DemoApp
or
.somepackage.DemoApp
. Just noticied the
.
before
DemoApp
and maybe your application class is not in the root package
j

johnsinguay

02/13/2018, 10:23 AM
In the past, I tend to place the custom Application class in the root package, now I place it in a folder along with other application-wide stuff. The behavior remains the same for me 🤔
2 Views