I want to use this answer in Kotlin: https://stackoverflow.com/a/30337653/12478830
It works correctly for me but I get this warning 'onPrepareOptionsPanel(View?, Menu): Boolean' is deprecated. Deprecated in Java. What should I use instead of it?
I want to use this answer in Kotlin: https://stackoverflow.com/a/30337653/12478830
It works correctly for me but I get this warning 'onPrepareOptionsPanel(View?, Menu): Boolean' is deprecated. Deprecated in Java. What should I use instead of it?
From the Android source code:
/**
* @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)
.