I keep getting an error saying that ActionBarDrawerToggle cannot be applied to v7.widget.Toolbar, and because I watched others fix a similar problem, they now support the support library files, but for some reason the error does not disappear.
The error says that the ActionBarDrawerToggle() in the ActionBarDrawerToggle cannot be applied to android.support.v7.widget.Toolbar , and then with the actual argument R.id.drawable_ic_drawer (int)
import android.support.v7.app.ActionBarDrawerToggle; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.content.SharedPreferences; import android.content.res.Configuration; import android.os.Bundle; import android.preference.PreferenceManager; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.Toast; import android.support.v7.widget.Toolbar;
mDrawerToggle = new android.support.v7.app.ActionBarDrawerToggle( getActivity(), mDrawerLayout, R.drawable.ic_drawer, R.string.navigation_drawer_open, R.string.navigation_drawer_close ) {
The part that is said to make a mistake is R.drawer.ic_drawer. How to resolve it?
android navigation-drawer android-toolbar
Vimbainashe e mushayikwa
source share