Service in a library project

I am using a service inside a library project. When I start the service (using context.startService(service)

) the onStart()

service was never reached. I am doing something wrong and I have some leading questions:

  • In which manifest file should I declare the service (library project or APK project)?

  • Is there any connection to remote services and AIDL? I'm not sure about this, but found this answer Android service in the library and it seems to me that I should create AIDL in the same application where I don't have Inter Process Communication (IPC).

  • I tried to extend the library service in my APK project and declare it in the APK manifest file, but still the onStart () service was never reached.

Thank.

+3


source to share


2 answers


Check out this link , for help on how to set up the * .aidl file, look at this question .



0


source


the onStart () method was deprecated in API level 5, so on Android 2.0 or newer onStart()

won't be called, you will need to inject onStartCommand (Intent, int, int) instead.



Update: AS @David Wasser pointed out my silly mistake. Can you check that you are not overriding the onStartCommand () method, or if you are overriding onStartCommand () then you are calling super.onStartCommand () from there .. Please show us some code ...

-2


source







All Articles