[英]'onPrepareOptionsPanel(View?, Menu): Boolean' is deprecated. Deprecated in Java
I want to use this answer in Kotlin: https://stackoverflow.com/a/30337653/12478830我想在 Kotlin 中使用这个答案: https://stackoverflow.com/a/30337653/12478830
It works correctly for me but I get this warning 'onPrepareOptionsPanel(View?, Menu): Boolean' is deprecated.它对我来说可以正常工作,但我收到此警告'onPrepareOptionsPanel(View?, Menu): Boolean' is deprecated。 Deprecated in Java .在 Java 中已弃用。 What should I use instead of it?我应该用什么来代替它?
From the Android source code :来自Android 源代码:
/**
* @hide
* @deprecated Override {@link #onPreparePanel(int, View, Menu)}.
*/
@SuppressWarnings("DeprecatedIsStillUsed")
@RestrictTo(LIBRARY_GROUP_PREFIX)
@Deprecated
protected boolean onPrepareOptionsPanel(@Nullable View view, @NonNull Menu menu) {
return super.onPreparePanel(Window.FEATURE_OPTIONS_PANEL, view, menu);
}
In other words you should use Activity.onPreparePanel(int, View, Menu)
.换句话说,您应该使用Activity.onPreparePanel(int, View, Menu)
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.