Adithya
Adithya

Reputation: 2975

Android Intent Actions

Can anyone tell me which all Intent Actions are there in Android. I couldn't find any package as android.intent... for the Intent android.intent.action.BOOT_COMPLETED ! So, i am assuming this action might be somewhere else in the android source.

I am asking this question because i wanted to register my Service with a Broadcast Receiver which will run after the booting is completed. I have added the intent-filter android.intent.action.BOOT_COMPLETED in AndroidManifest.xml but still the service doesn't start after the BroadcastReceiver's onReceive() method is called. So,i am thinking of registering my service with the receiver in onCreate() method of the service and i need the Intent-Filter and its correponding Action to be set.

Thanks, Adithya.

Upvotes: 0

Views: 2377

Answers (2)

CommonsWare
CommonsWare

Reputation: 1006584

Can anyone tell me which all Intent Actions are there in Android.

No. Any string can be used as an action.

I am asking this question because i wanted to register my Service with a Broadcast Receiver which will run after the booting is completed. I have added the intent-filter android.intent.action.BOOT_COMPLETED in AndroidManifest.xml but still the service doesn't start after the BroadcastReceiver's onReceive() method is called. So,i am thinking of registering my service with the receiver in onCreate() method of the service and i need the Intent-Filter and its correponding Action to be set.

Here is a sample project demonstrating the use of a BOOT_COMPLETED BroadcastReceiver.

Note that starting a service from a BOOT_COMPLETED BroadcastReceiver is typically not a good idea, because that suggests that you are trying to have a service run all of the time, and that is unlikely to work and is very likely to irritate users. Please consider using a polling architecture using AlarmManager.

Upvotes: 1

Related Questions