title: How to get rootview in fragment?
body: <p>I am using this library for using an emoji keyboard on my app.
  <a href="https://github.com/ankushsachdeva/emojicon" rel="noreferrer">https://github.com/ankushsachdeva/emojicon</a></p>
  
  <p>The Readme states that the topmost view of your activity layout hierarchy has to be used to initialize the popupwindow.</p>
  
  <p>My app is implemented via fragments.</p>
  
  <p>This is the code I am using for testing:</p>
  
  <pre><code>public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
  
      View view = inflater.inflate(R.layout.overview1_layout, container,
              false);
  
      // Give the topmost view of your activity layout hierarchy. This will be used to measure soft keyboard height
      EmojiconsPopup popup = new EmojiconsPopup(view, getActivity());
  
      //Will automatically set size according to the soft keyboard size        
      popup.setSizeForSoftKeyboard();
  
      popup.showAtBottom();
  
  
      return view;
  }
  </code></pre>
  
  <p>If I run this code I am getting following error in logcat:</p>
  
  <pre><code>11-02 22:37:16.685: E/AndroidRuntime(30363): java.lang.RuntimeException: Unable to resume activity {com.Testing.full/com.Testing.full.MainActivity}: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
  </code></pre>
  
  <p>EDIT: I am using SherlockFragment</p>