I know that this is a very old question, but with the new Android API (currently I'm working on API 19+) could we do it?
I can not remove:
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
from manifest file because Android studio will not compile the app:
Default Activity not found
Updated: Thanks all, I have decided to do it programmatically
because Android studio will not compile the app
Yes, it will. Build > Build APK works just fine.
Android Studio will not run the app, because it does know how to run such an app, but that does not prevent you from compiling the app and generating an APK.
Application without app launcher icon
This situation has not changed significantly since Android 3.1. You are welcome to write an app without a launcher icon. Outside of a few specialized scenarios, that app will be useless, as none of its code will ever run.
I'm creating an application that runs only in background. I had this same problem, having to create an activity that did nothing just to execute the finish()
method.
So I found this question: (https://stackoverflow.com/a/16603708/7548147), all you have to do (in Android Studio) is Go to RUN -> Edit Configurations... and Launch Option-> Launch: choose nothing option.
After this, you'll be able to delete your code in Mainfest
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