@ Override public void onDestroy () { unregisterReceiver (receiver); }
@ Override public int onStartCommand (Intent intent, int flags, int startId) { return super.onStartCommand (intent, flags, startId);
} }
This is a service class
But in actual service bindings attempt did not respond, can not always go in service in onCreate () method, I also checked the Android official document or puzzled.
Ask colleagues to help us to see the problem in that. <-! Main posts under Banner (D4) -><-! Posts under the main text (D5) -> Reply: service is registered Reply: Existing broadcast network changes have you write a class monitor trouble themselves to death Dynamic landing when using IntentFilter Register Login finished look you need to cancel the registration at the appropriate time Reply: No recent onCreate () service failed to start only should you not registered it Reply:
This is my registration service, so there is no problem to write? Reply:
at the appropriate time Understand what you mean, but I just want to practice using the service component Ha, thank you for your reply.
I feel my debugging for a long time to write without errors do not always know why bind unsuccessful. Reply:
Your Service a bit strange ah you use the Service Binder that you should inherit is aidl compiler generated service interfaces ah This direct use startService stopService you can ah Reply: No permission to add the network? Reply: Wrong wrong ...... you. . . . @ Override public IBinder onBind (Intent intent) { return new IntenetBinder (); } public class IntenetBinder extends Binder { / ** * Return the network status * * @ Return * / public InternetListener getService () { return new IntenetBinder (); } }
private ServiceConnection conn = new ServiceConnection () {
getNetStatus () method should be the service, rather than a method binder; Reply: service is registered, is bound to repeat Reply:
Existing broadcast network changes have you write a class monitor trouble themselves to death Dynamic landing when using IntentFilter Register Login finished look you need to cancel the registration
at the appropriate time Understand what you mean, but I just want to practice using the service component Ha, thank you for your reply.
I feel my debugging for a long time to write without errors do not always know why bind unsuccessful.
Your Service a bit strange ah you use the Service Binder that you should inherit is aidl compiler generated service interfaces ah This direct use startService stopService you can ah
It is not cross-process calls aidl I call a local service, so that activity and service communication, startService do it? Reply:
Wrong wrong ...... you. . . . @ Override public IBinder onBind (Intent intent) { return new IntenetBinder (); } public class IntenetBinder extends Binder { / ** * Return the network status * * @ Return * / public InternetListener getService () { return new IntenetBinder (); } }
private ServiceConnection conn = new ServiceConnection () {
getNetStatus () method should be a service, rather than the binder method;
Brothers getNetStatus This method is what I wrote ah I inherited binder is then added to this method, how to become a service approach? Reply:
service is registered, if repeated bind
service registered no duplicate bindings binding code stickers out.
No permission to add the network?
The authority added Ha Reply: There is no error logcat you look about her. . . . Reply:
you look logcat have given her. . . .
Not wrong brother
Which Great God help me find ah? Reply:
Existing broadcast network changes have you write a class monitor trouble themselves to death Dynamic landing when using IntentFilter Register Login finished look you need to cancel the registration
at the appropriate time Understand what you mean, but I just want to practice using the service component Ha, thank you for your reply.
I feel my debugging for a long time to write without errors do not always know why bind unsuccessful.
Your Service a bit strange ah you use the Service Binder that you should inherit is aidl compiler generated service interfaces ah This direct use startService stopService you can ah
It is not cross-process calls aidl I call a local service, so that activity and service communication, startService do it?
You can ... startService Reply:
There is no error logcat you look about her. . . .
Not wrong brother
Which Great God help me find ah?
If the service does not usually have given up right Or you try to add a little log or directly with a single step debugging went to see where Reply:
There is no error logcat you look about her. . . .
Not wrong brother
Which Great God help me find ah?
If the service does not usually have given up right Or you try to add a little log or directly go to step through to see the
Really there is no error, which started service through the normal step, but that is not starting up
No comments:
Post a Comment