How to kill synergy/evict all connections
Solution 1
I was having the same issue with server running on Fedora 16 and client on Windows 7. I finally found that the problem was that although I was stopping the client application from the PC toolbar there were actually client processes still running which were consequently keeping a connection open with the PC's name.
I killed in task manager restarted and that solved my problem.
Solution 2
have you tried ps -ef | grep synergy
instead
Related videos on Youtube
StuStirling
Updated on September 18, 2022Comments
-
StuStirling almost 2 years
I'm not sure if this is the correct way to go about but I will try and explain what I want to do.
I have an
Activity
which creates afragment
calledTemporaryFragment
with a label. What I want to do is create and start a service with aTimer
in it and thatTimer
then updates the time in thatTextView
.The way I am thinking of going is somehow, when the
Service
is started, passing theTextView
from theActivity
to theService
and then theService
keeping a reference to it.Another possible way is to make the
Activity
become a listener of theService
and then calling a method in theService
to update theTextView
.Any thoughts would be great and maybe some options.
Thanks in advance.
ADDITION I'm sorry, I should also specify that I need this timer to run in the background. So when the application is sent to the background, I need the timer to carry on and only stop when I tell it to.
-
pl1nk about 12 yearsHave you resolved your question?
-
Mikey about 12 yearsI'm not sure. I'll play around with it more and try to accept an answer. I've just been being real careful about trying not to reboot anything.
-
-
StuStirling almost 12 yearsI am going to try and implement this option. One problem, when create the handler
private final Handler handler = new Handler(this);
it wants me to remove the context? -
chrulri almost 12 yearsAs you can see in my code example,
this
(MainActivity
) implements theCallback
interface (calling thehandleMessage(..)
method) -
StuStirling almost 12 yearssorry I have added an addition to my question above
-
StuStirling almost 12 yearssorry I have added an addition to my question above
-
StuStirling almost 12 yearssorry I have added an addition to my question above
-
chrulri almost 12 yearsYou cannot update something in an Activity which is already gone (e.g. background). You may continue updating it as soon as the activity is re-startet (e.g.
onStart()
) -
biegleux almost 12 yearsStill you can use Handler and call removeCallbacks() only in onDestroyView() or onDestroy() method of your fragment. Also in onPause() you can set a flag to not update UI while still execute some counting in your task and in onResume() you set the flag back to update UI. This way your task is execute while the fragment and it's particular view exists and updates it only if is visible.
-
StuStirling almost 12 yearsso I come from an iOS background and the apps have the ability to continue running in the background. Is that not the case in android, when you go back out of an application thats it?
-
chrulri almost 12 yearsActivities are only active as long as they are in foreground. They may be destroyed if they are not used anymore. Read more about this: here But this does not mean that your application gets terminated. You are able to run more stuff in background using a
Service
. BUT, it does not make any sense to update UI stuff (e.g. Views in an activity) which is not visible/available to the user. As I said, you may update the UI when the Activity is re-started. What is your goal? -
StuStirling almost 12 yearsBasically, the idea behind the timer is eventually I am going to add some tracking into my application and therefore need it to continue running even if the application isn't in the foreground
-
chrulri almost 12 yearsWell this is definitly another use case. See my other answer.
-
StuStirling almost 12 yearswould i need to bind or just start my service. I do probably need to access it again whilst its running so I'm thinking I need to bind. However, does that mean it will still run when the application is sent to background?
-
chrulri almost 12 yearsYou need to start the service with
START_STICKY
as return value inonStartCommand(..)
. Start it by any activity or on application start usingContext#startService(..)
and stop it whenever you want withContext#stopService(..)
whereas your activities can bind and unbind as often as you want. reference: developer.android.com/reference/android/app/… -
StuStirling almost 12 yearsI have got it working and comunicating with the activity by passing the service a handler and then send a message back
-
H.Karatsanov about 4 years@biegleux if we apply this solution in context of an activity, if it okay to create a separate Thread for it just to take off some from the main Thread?