title: Get Window object in an app that doesn't have an Activity
body: <p>I have an Android application that consists of a Service and a View only. I don't use any activities.</p>
  
  <p>The View is inflated in the Service onCreate method similar to the code block below.</p>
  
  <pre><code>@Override
  public void onCreate() {
      super.onCreate();
      WindowManager windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
  
      LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
      // The floater layout is on top of everything. It does not have a parent.
      floaterView = (FrameLayout) inflater.inflate(R.layout.floaterView, null);
  
      WindowManager.LayoutParams params = new WindowManager.LayoutParams(&lt;set params&gt;);
      windowManager.addView(floaterView, params);
  }
  </code></pre>
  
  <p>I want to get a reference to the Window object (<a href="https://developer.android.com/reference/android/view/Window.html" rel="nofollow noreferrer">https://developer.android.com/reference/android/view/Window.html</a>) that is connected to this process, but this is usually done with Activity.getWindow().
  Since I don't have/want an Activity in my application, this is not possible. I came across methods like View.getWindowToken and View.getWindowId. Maybe I can use these to get the Window?</p>
  
  <p>My question is: How can I get a reference to the Window/Windows objects that are created in this process? </p>