@Override public int onStartCommand(Intent intent, int flags, int startId) { if (!ReceiverService.running()) { startReceiving(); } return Service.START_STICKY; }
@Override public void onDestroy() { Log.i(TAG, "onDestroy()"); if (ReceiverService.running()) { stopReceiving(); } toast("Message receiver stopped"); super.onDestroy(); }