I'm not sure,
, - (Intent service), , , , , , .
.:
IntentService
https://developer.android.com/guide/components/services.html
, IPC (Inter Process Communication). RPC.
-, :
public class BasicService extends Service {
public BasicService() {
}
@Override
public IBinder onBind(Intent intent) {
throw new UnsupportedOperationException("Not yet implemented");
}
@Override
public void onCreate() {
Toast.makeText(this, "My service is created", Toast.LENGTH_LONG).show();
}
@Override
public void onStart(Intent intent, int startId) {
Toast.makeText(this, " Starting service", Toast.LENGTH_LONG).show();
}
@Override
public void onDestroy() {
Toast.makeText(this, "Service Destroyed", Toast.LENGTH_LONG).show();
}
}
, , stopSelf().
stopService(new Intent(this, BasicService.class));
, :
startService(new Intent(this, BasicService.class));
, .
.
.