package com.example.persons.service; import android.content.Context; import android.content.Intent; import android.os.ResultReceiver; public class PersonServiceHelper { private static PersonServiceHelper _instance = null; private PersonServiceHelper () { } private synchronized static void createInstance () { if ( _instance == null ) _instance = new PersonServiceHelper (); } public static PersonServiceHelper getInstance () { if ( _instance == null ) createInstance (); return _instance; } public void getPersons ( Context context, ResultReceiver receiver ) { final Intent intent = new Intent ( Intent.ACTION_SYNC, null, context, PersonService.class ); intent.putExtra ( PersonService.EXTRA_STATUS, receiver ); intent.putExtra ( PersonService.EXTRA_REST_OPERATION, PersonService.GENERAL_REST_OPERATION ); context.startService ( intent ); } }