菜鸟初学Service
1. onStart() ,onStartCommand() instead.
As Follows :
-------------------------------------------------
onStart() public void onStart(Intent intent, int startId) { }
public int onStartCommand(Intent intent, int flags, int startId) { onStart(intent, startId); return mStartCompatibility ? START_STICKY_COMPATIBILITY : START_STICKY; }
void onStart(Intent intent, int startId)This method is deprecated. Implement onStartCommand(Intent, int, int) instead.onStart方式已经过时,被onStartCommand取代 int onStartCommand(Intent intent, int flags, int startId)Called by the system every time a client explicitly starts the service by calling startService(Intent), providing the arguments it supplied and a unique integer token representing the start request.