I found my answer. To remove an activity, let the name of the activity is activity:
- Remove the
activity.javafile fromsrcfolder (java/your.package.namefolder for AndroidStudio) - Remove the
activity.xmlfile fromlayoutsfolder (layoutfolder for AndroidStudio) - Remove the
activity.xmlfile fromres/menufolder (this is an optional folder) - Remove the
<activity></activity>block of the activity from themanifestfile - If the
<activity>block in themanifestfile has a reference (usually inandroid:labeltag) remove the referenced value (usually fromvalues/strings.xml).
According to answers from @ojonugwa ochalifu and @Md Tarik Mahmud you should also right click on app folder then Refractor -> Remove Unused Resources