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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -