I remember (although I am not sure any more) I read that IntelliJ IDEA IDE can automatically add newly crated Activities
into the Manifest
file. However, this does happen in my projects. Is there a special command for that or this feature does not exist?
In the Project View use New | Android Component | Activity, type name, like Sample
, you will get a Java source file created that extends Activity
and <activity android:name=".view.Sample"/>
line in the AndroidManifest.xml
.
In older IDEA versions there were separate New menu items for Activity, Service, etc.
Sorry for the shameless plug but if you want to add your activity in the manifest you can use a plugin I wrote for myself.
When you have an Activity or a class that inherits from Activity at some point that has no mention in the AndroidManifest.xml you can press (CMD/CTRL+N) and press 'add to manifest'. This adds the activity to the manifest.
https://dl.dropboxusercontent.com/u/3491432/AndroidManifestFitter.jar
Source code: https://github.com/JorgeDC/AndroidManifestFitter
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With