Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Declaring classes in AndroidManifest.xml

I understand that, in Android, all activities must be declared within the manifest. Is this true to all .java files in the project?

I have a few classes that aren't activities (not directly related to an UI) and i'm unsure whether I need to declare them in the manifest.

Thanks!

like image 261
tyb Avatar asked Mar 04 '26 13:03

tyb


2 Answers

No, only activities. All other java classes don't have to be declared in the manifest file to be used. If you're having contentproviders or services in your application you also need to declare them in the manifest file.

like image 76
J. Maes Avatar answered Mar 06 '26 01:03

J. Maes


You don't have to declare all classes in the manifest. Things you do need to declare are Activities, Services and ContentProviders.

like image 42
Jan-Henk Avatar answered Mar 06 '26 01:03

Jan-Henk