I keep getting this warning in my code, and I start to worry, as I am close to my deadline. I have a DrawerLayout in my main action, using the Android Studio's own box activity, but I had to make a small change to the code, because the DrawerLayout setDrawerListener is now deprecated.
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);
I get a warning on drawer.addDrawerListener(toggle)
and navigationView.setNavigationItemSelectedListener(this)
Further in my code, I also get it in this method:
@Override public void onBackPressed() { DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); if (drawer.isDrawerOpen(GravityCompat.START))
Thanks in advance to everyone who may have an idea of ββwhat causes him. I searched for this problem, but I could not find an example of the post postrecated method.
source share