咱们先看下源码里面怎么说的:
/**
* Sets whether the WebView should enable plugins. The default is false.
*
* @param flag true if plugins should be enabled
* @deprecated This method has been deprecated in favor of
* {@link #setPluginState}
* @hide Since API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2}
*/
@SystemApi
@Deprecated
public abstract void setPluginsEnabled(boolean flag);
意思是说这个过期了,建议使用setPluginState这个方法。
然后接着看setPluginState方法:
/**
* Tells the WebView to enable, disable, or have plugins on demand. On
* demand mode means that if a plugin exists that can handle the embedded
* content, a placeholder icon will be shown instead of the plugin. When
* the placeholder is clicked, the plugin will be enabled. The default is
* {@link PluginState#OFF}.
*
* @param state a PluginState value
* @deprecated Plugins will not be supported in future, and should not be used.
*/
@Deprecated
public abstract void setPluginState(PluginState state);
意思是说这个也过期了,因为Plugins 将来就不支持了,所以最好不要用。
明白了吗?