Is It Possible to Create an Activity in Android Without a User Interface?
Contents

Can we create activity without UI in Android?

mentioned by Brian515 works great. This method is useful for creating an entry point Activity that decides on which activity to call, start, services, etc without having to show a UI to the user. Remember to use finish() after you have started your intent.

Is it possible to have an activity without UI to perform action?

The answer is yes it’s possible. Activities don’t have to have a UI. It’s mentioned in the documentation, e.g.: An activity is a single, focused thing that the user can do.

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest