Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8155695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:44:26+00:00 2026-06-06T16:44:26+00:00

using gingerbread 2.3.4 api lvl 10. I am starting a service after boot completed.

  • 0

using gingerbread 2.3.4 api lvl 10.

I am starting a service after boot completed. To do so I added a broadcast receiver which starts the service.I am using the same service in the launcher. I am trying to bind to service by adding extra params to Intent. Getting back results from service by broadcast reply.

The problem is when it first binds, the onBind() on the service is triggered. Further bindings does not call the onBind() on the service. I believe the problem is service starting directly after_boot. When I dont start the service in bootup and let the activity start it with Context.BIND_AUTO_CREATE it does behave as expected.

The only solution I came up with is changing the onUnbind() of the service and issuing onBind() in onRebind() call of the service. I dont like this solution since it might break in later android versions leading the onBind() method being called twice.

So why doesn’t subsequent binds are not triggered on the services which start up after boot completed. Any other elegant solutions are welcome.

PS: I already implemented it in aidl, but I dont like it, since the service will be doing some async stuff to return data back and I have to add aidl files in both apps, will add handlers which leads to bloated code.

Thanks in advance. Snippet of my code:

Manifest of the service:

        <intent-filter>
            <action android:name="com.organization.android.ACTION_BOOT_COMPLETED" />
        </intent-filter>

         <intent-filter>
            <action android:name="com.organization.android.WORK_INTENT" />
        </intent-filter>
    </service>

    <receiver android:name=".CoreServiceReceiver" >
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" >
            </action>

            <category android:name="android.intent.category.HOME" >
            </category>
        </intent-filter>
    </receiver>

When I bind to the service:

Intent intent = new Intent(WORK_INTENT);
intent.putExtra(“param”, param);

context.registerReceiver (broadcastReceiver, new IntentFilter("com.organization.android.WORK_RESULT"));
context.bindService(intent,mConnection, Context.BIND_AUTO_CREATE);        

}

When I get the result:

context.unbindService(mConnection);
context.unregisterReceiver (broadcastReceiver);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T16:44:29+00:00Added an answer on June 6, 2026 at 4:44 pm

    From the documentation on binding to services:

    Multiple clients can connect to the service at once. However, the
    system calls your service’s onBind() method to retrieve the IBinder
    only when the first client binds. The system then delivers the same
    IBinder to any additional clients that bind, without calling onBind()
    again.

    This behaviour will not change, so your method of overriding onUnbind to return true, and then calling onBind during onRebind is perfectly OK, although the original binding will still be sent to the client, not any new one that you may generate in your new call to onBind. (ie, you really shouldn’t be calling onBind, but just handling onRebind as a seperate case)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using android 2.3.3, I have a background Service which has a socket connection. There's
I'm using WROX Android Application Development which recommends using platform android 2.3 api 9
SOLVED: I was using icons from sdk v9 (Android 2.3 Gingerbread) which seems to
After I have downloaded a gingerbread system build using the following commands, how do
I am using WebSQL for my PhoneGap application it is fine for GingerBread and
Can a program that is written using the gingerbread/froyo/eclair (e.g. 2.1, 2.2, 2.3 ->
I'm trying to write a voip app for Android, using the Android SIP API
My app runs great on the ICS emu. However, using Gingerbread, it crashes whenever
I am using android x86 gingerbread live cd, when i am tring to give
I'm working on a Gingerbread (2.3.3) device. I have an ImageView which contains an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.