1

I want to code android application without icon in the main menu of android, my application must start the activity one time after installing the application by using the run button, and then after the first time my application run a service for ever. So I have many ideas for doing this:

  1. Start the service on application start and thin the service chick if this is the first start time, so my question how I can start the service without starting any activity?

  2. run activity in the first time, this activity start the service and this end this activity, so my question how I can code the application with out icon in the main menu?

But don't till my do delete the <intent-filter> or <category>, because it does not work!!!!

Bernhard Barker
  • 54,589
  • 14
  • 104
  • 138

1 Answers1

1

I don't quite understand what you mean by not showing an icon in the main menu. Do you mean that you don't want your app to appear on the launcher? I don't think this is possible, since the OS will extract your app's launcher icon automatically.

As for your questions:

1- You can implement a Broadcast receiver, which will listen to the BOOT_COMPLETED event. This way, you don't have to launch any activity, and you can start your service at the very moment the phone boots up. See this question for an example.

2- Again, I don't think this is possible.

Community
  • 1
  • 1
verybadalloc
  • 5,768
  • 2
  • 33
  • 49