diff --git a/graphenej/src/main/java/cy/agorise/graphenej/api/android/NetworkServiceManager.java b/graphenej/src/main/java/cy/agorise/graphenej/api/android/NetworkServiceManager.java index 28f17b1..beb4f05 100644 --- a/graphenej/src/main/java/cy/agorise/graphenej/api/android/NetworkServiceManager.java +++ b/graphenej/src/main/java/cy/agorise/graphenej/api/android/NetworkServiceManager.java @@ -78,7 +78,10 @@ public class NetworkServiceManager implements Application.ActivityLifecycleCallb public void onActivityCreated(Activity activity, Bundle bundle) { } @Override - public void onActivityStarted(Activity activity) { + public void onActivityStarted(Activity activity) { } + + @Override + public void onActivityResumed(Activity activity) { mHandler.removeCallbacks(mDisconnectRunnable); if(mService == null){ // Creating a new Intent that will be used to start the NetworkService @@ -101,14 +104,10 @@ public class NetworkServiceManager implements Application.ActivityLifecycleCallb .putExtra(NetworkService.KEY_CUSTOM_NODE_URLS, customNodes) .putExtra(NetworkService.KEY_AUTO_CONNECT, mAutoConnect) .putExtra(NetworkService.KEY_ENABLE_LATENCY_VERIFIER, mVerifyLatency); - context.bindService(intent, mServiceConnection, Context.BIND_AUTO_CREATE); } } - @Override - public void onActivityResumed(Activity activity) {} - @Override public void onActivityPaused(Activity activity) { mHandler.postDelayed(mDisconnectRunnable, DISCONNECT_DELAY);