Most visited

Recently visited

Added in API level 11

WebViewFragment

public class WebViewFragment
extends Fragment

java.lang.Object
   ↳ android.app.Fragment
     ↳ android.webkit.WebViewFragment


显示WebView的片段。

当片段暂停或恢复时,WebView将自动暂停或恢复。

Summary

Inherited XML attributes

From class android.app.Fragment

Inherited constants

From interface android.content.ComponentCallbacks2

Public constructors

WebViewFragment()

Public methods

WebView getWebView()

获取WebView。

View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)

被调用来实例化视图。

void onDestroy()

当碎片不再使用时调用。

void onDestroyView()

当WebView已从片段中分离时调用。

void onPause()

当片段对用户可见且正在积极运行时调用。

void onResume()

当碎片不再恢复时调用。

Inherited methods

From class android.app.Fragment
From class java.lang.Object
From interface android.content.ComponentCallbacks2
From interface android.view.View.OnCreateContextMenuListener
From interface android.content.ComponentCallbacks

Public constructors

WebViewFragment

Added in API level 11
WebViewFragment ()

Public methods

getWebView

Added in API level 11
WebView getWebView ()

获取WebView。

Returns
WebView

onCreateView

Added in API level 11
View onCreateView (LayoutInflater inflater, 
                ViewGroup container, 
                Bundle savedInstanceState)

被调用来实例化视图。 创建并返回WebView。

Parameters
inflater LayoutInflater: The LayoutInflater object that can be used to inflate any views in the fragment,
container ViewGroup: If non-null, this is the parent view that the fragment's UI should be attached to. The fragment should not add the view itself, but this can be used to generate the LayoutParams of the view.
savedInstanceState Bundle: If non-null, this fragment is being re-constructed from a previous saved state as given here.
Returns
View Return the View for the fragment's UI, or null.

onDestroy

Added in API level 11
void onDestroy ()

当碎片不再使用时调用。 销毁WebView的内部状态。

onDestroyView

Added in API level 11
void onDestroyView ()

当WebView已从片段中分离时调用。 在此之后,WebView不再可用。

onPause

Added in API level 11
void onPause ()

当片段对用户可见且正在积极运行时调用。 恢复WebView。

onResume

Added in API level 11
void onResume ()

当碎片不再恢复时调用。 暂停WebView。

Hooray!