In my android application I see the following error:
setDrawerListener(android.support.v4.widget.Drawer Layout.DrawerListener)' is deprecated
How i can resolve this?
In one answer I see use addDrawerListener()
instead setDrawerListener
but it does not seem to work.
Instead of using setDrawerListener()
, you could use addDrawerListener()
.
public void setDrawerListener(DrawerLayout.DrawerListener listener)
Sets a listener to be notified of drawer events.Note that this method is deprecated and you should use
addDrawerListener(DrawerLayout.DrawerListener)
to add a listener andremoveDrawerListener(DrawerLayout.DrawerListener)
to remove a registered listener.