How to add new activity to existing project in Android Studio?
Solution 1:
To add an Activity
using Android Studio.
This step is same as adding Fragment, Service, Widget, and etc. Screenshot provided.
[UPDATE] Android Studio 3.5. Note that I have removed the steps for the older version. I assume almost all is using version 3.x.
- Right click either java package/java folder/module, I recommend to select a java package then right click it so that the destination of the Activity will be saved there
- Select/Click New
- Select Activity
- Choose an Activity that you want to create, probably the basic one.
To add a Service
, or a BroadcastReceiver
, just do the same step.
Solution 2:
In Android Studio 2, just right click on app and select New > Activity > ... to create desired activity type.