Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically add activity to Manifest?

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?

like image 795
sandalone Avatar asked Jul 10 '11 08:07

sandalone


2 Answers

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.

like image 132
CrazyCoder Avatar answered Sep 22 '22 16:09

CrazyCoder


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

like image 41
JorgeDeCorte Avatar answered Sep 20 '22 16:09

JorgeDeCorte