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

  • Home
  • SEARCH
  • 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 8922811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:56:30+00:00 2026-06-15T06:56:30+00:00

I am receiving a boot completed intent in my BootReceiver class and start a

  • 0

I am receiving a boot completed intent in my BootReceiver class and start a service when I receive that intent.

@Override
public void onReceive(Context arg0, Intent arg1) {
    Intent myIntent = new Intent(arg0, BootService.class);
    arg0.startService(myIntent);    
}

The service is started normally and now, I want to use the binder object within the service . Here is the service code.

public class BootService extends Service implements IBinder{
private IBinder binder;

public class LocalBinder extends Binder {
    IBinder getService() {
        return BootService.this;
    }
}

@Override
public void onCreate() {
    super.onCreate();
    Log.d("BootService", "onCreate()");

}

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    Log.d("BootService", "onStartCommand()");
    binder = new LocalBinder().getService();
    //This doesn't seem to work
    //I wana use this binder object here

    return START_STICKY;
}
.....
}

I am not sure if this is the correct way to get a binder.
Any help is much appreciated!!

  • 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-15T06:56:31+00:00Added an answer on June 15, 2026 at 6:56 am
    In ur Acivity 
    @Override
        protected void onStart() {
            super.onStart();
    
            Intent intent = new Intent(getApplicationContext(), MyService.class);
            bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
        }
        @Override
        protected void onStop() {
            super.onStop();
            unbindService(mConnection);
        }
    
    
    
        private ServiceConnection mConnection = new ServiceConnection() {
    
            @Override
            public void onServiceDisconnected(ComponentName name) {
    
            Toast.makeText(getApplicationContext(), "Service disconnected", 1000).show();
            mBindr = false;
            }
    
            @Override
            public void onServiceConnected(ComponentName name, IBinder service) {
                Toast.makeText(getApplicationContext(), "Service connected", 1000).show();
                LocalBinder mLocalBinder = (LocalBinder) service;
                myService = mLocalBinder.getSrvice();
                mBindr = true;
            }
        };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im receiving an intent in broadcast receiver and then i start service to do
When receiving an incoming msessage I receive a correct result when my packet structure
I'm receiving JSON, that i need to Deserialize. I'm using JavaScriptSerializer to do so.
Im receiving this <header><h1>001</h1><h2>002</h2></header> my dispatcher looks like this <bean id=annotatedMarshaller class=org.springframework.oxm.xstream.AnnotationXStreamMarshaller> <property name=annotatedClasses>
I'm receiving feedback from a developer that The only way visual basic (6) can
Im receiving this error The name 'Textbox1' does not exist in the current context
When receiving an array from flash, in C, how do I populate that array
Receiving back Non-Parseable JSON Response. I receive back the JSON fine but it's in
I am receiving a fatal error in my php/mysqli code which states that on
When receiving data through a socket using recv , I've noticed that, with: char

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.