public class AircraftFragmentTab extends Fragment{
      private String ac;

      public AircraftFragmentTab(String AC){
          ac = AC;

      }
         @Override
         public View onCreateView(LayoutInflater inflater, ViewGroup container,
         Bundle savedInstanceState)
         {
             View aircraftView = inflater.inflate(R.layout.acdetails, container, false);

             ??? getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
              WebView wv = (WebView) aircraftView.findViewById(R.id.webac);
              wv.getSettings().setJavaScriptEnabled(true);
              wv.loadUrl("http://ABCD/ACInfo.aspx?AC=" + ac);

             return aircraftView;
         }
}
我正在使用webView,并且Fragment扩展了类。如何在这里使用getWindow()

最佳答案

你可以使用getActivity().getWindow()getActivity()将返回当前与该片段关联的 Activity 。

关于android - Android Fragment和getWindow(),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7600858/

10-09 10:01