Chronometer keep in background time spent
<p>i would developing a feature in my app that when click on button on my activity launch a <code>service</code> that start,pause and resume a <code>Chronometer</code>.
But I have a problem how start and stop in my background <code>service</code>.</p>

<p>I created my <strong>Activity</strong></p>

<pre><code>public class StartWorkActivity extends ActivityGeneralToolbar {

    protected final void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState, R.layout.activity_start_work);
        Chronometer chronometer = (Chronometer) findViewById(R.id.chronometer);



    }

    @Override
    protected void onStop() {
        super.onStop();
    }

    public void startWork(View v){
        Intent msgIntent = new Intent(StartWorkActivity.this, WorkTimerService.class);


        msgIntent.setAction("START_TIMER");
        getBaseContext().startService(msgIntent);
    }

    public void pauseWork(View v){
        Intent msgIntent = new Intent(StartWorkActivity.this, WorkTimerService.class);
        msgIntent.setAction("PAUSE_TIMER");

    }

    public void resumeWork(View v){
       //call service
        Intent msgIntent = new Intent(StartWorkActivity.this, WorkTimerService.class);
        msgIntent.setAction("RESUME_TIMER");


    }


    @Override
    protected void onPause() {
        super.onPause();
    }

    @Override
    protected void onResume() {

        super.onResume();
    }
}
</code></pre>

<p>And my <strong>WorkTimerService</strong></p>

<pre><code>public class WorkTimerService extends IntentService {

    long timeWhenStopped = 0;
    Chronometer chronometer;

    public WorkTimerService() {
        super("SystemService");

    }

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    protected void onHandleIntent(Intent intent) {
        if(intent.getAction() == "START_TIMER"){
            startWork();
        }
        if(intent.getAction() == "PAUSE_TIMER"){
            pauseWork();

        }if(intent.getAction() == "RESUME_TIMER"){
            resumeWork();
        }
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        super.onStartCommand(intent, flags,startId);

        return START_STICKY;
    }
    public void pauseWork(){

        timeWhenStopped = chronometer.getBase() -  SystemClock.elapsedRealtime();
        chronometer.stop();
    }

    public void resumeWork(){

        chronometer.setBase(SystemClock.elapsedRealtime() + timeWhenStopped);
        timeWhenStopped = 0;
        chronometer.start();

    }

    public void startWork(){

        chronometer.start();
    }
}
</code></pre>

<p>But my problem is that <code>Chronometer</code> obviously is null in my service, because I read that is not possible, in the service, interact with the ui.
And so, how i can send, or work with <code>Chronometer</code> in background?</p>