title: Why softkeyboard won't display in Fragment with WebView
body: <p>I am using the compatibility package and I have a <code>Fragment</code> who returns a <code>WebView</code> in onCreateView.  The problem is if the fragment isn't added during onCreate of the <code>Activity</code> then when a textbox is clicked inside of the <code>WebView</code> the softkeyboard is not displayed.  If the device is rotated after the the custom web fragment has been added, recreating the activity, then the softkeyboard is displayed when clicking on a text field.</p>
  
  <p>Just to be clear Here are the two different scenarios </p>
  
  <pre><code>public void onCreate(Bundle state){
     if(state == null){
        WebFragment web = new WebFragment();
        getSupportFragmentManager.beginTransaction().add(android.R.id.content, web).commit();
     }
  }
  
  
  
  public void onClick(View v){
        WebFragment web = new WebFragment();
        getSupportFragmentManager.beginTransaction().add(android.R.id.content, web).commit();
  }
  </code></pre>
  
  <p>In the first case when adding the fragment during the Activity onCreate method then the WebView contained in the fragment works as it should when text fields are pressed. However, in the second example nothing happens when clicking a text field in the webview unless you rotate the device after the webview had been displayed.  Can someone offer up a solution, if I have to create a new activity for my fragment to work properly it sorta beats the purpose of the fragment in the first place.</p>