title: How to get UserHandle of activity in multi user system
body: <p>I have a service that runs in the background that monitors the foreground activity. At present this does not distinguish between users (multi user accounts Android 4.2). Is there a way that the service can compare the user it is running under with that of the foreground activity? I am only interested in activities of the same user account that the service is running under.</p>
  
  <p>I know I can use:</p>
  
  <pre><code>android.os.Process.myUserHandle()
  </code></pre>
  
  <p>to get the UserHandle that the service is running under. But I can't see anything in the docs that can give me the UserHandle of a running activity (ActivityManager.RunningAppProcessInfo etc).</p>
  
  <p>Any ideas?</p>