How to execute background task when Android app is closed / set to background?
The following code will help you to post your contents when your app is closed or in the background: import android.app.Service; import android.content.Intent; import android.os.Binder; import android.os.Handler; import android.os.IBinder; import android.widget.Toast; public class SendDataService extends Service { private final LocalBinder mBinder = new LocalBinder(); protected Handler handler; protected Toast mToast; public class LocalBinder extends Binder … Read more