java - getActionView is deprecated? -
today decide translate android app java kotlin ! :) surprise when type :
val searchitem = menu.finditem(r.id.action_search) val searchview = menuitemcompat.getactionview(searchitem) searchview
and android studio told me : " 'getactionview(menuitem!):view!' deprecated. deprecated in java "
so before ask solution ask google solution , believed find solution : "use getactionview() directly."
so modified code :
val searchview = menuitemcompat.getactionview() searchview
but getactionview()
still crossed don't understand @ all...
i happy if can me :) thank !
the javadoc says:
use getactionview() directly.
hence, should is:
val searchview = searchitem.getactionview() searchview
Comments
Post a Comment