DrawerLayout and ActionBarDrawerToggle cannot be allowed for type

I try to implement ActionBarSherlock Side Menu Navigation Drawer in my application, but always get:

DrawerLayout cannot be allowed for type ActionBarDrawerToggle cannot be allowed for type

My import :

import android.content.res.Configuration; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import com.actionbarsherlock.app.SherlockFragmentActivity; import com.actionbarsherlock.view.MenuItem; 
+6
source share
2 answers

Import them from the support library

 import android.support.v4.app.ActionBarDrawerToggle; import android.support.v4.widget.DrawerLayout; 

check this

http://developer.android.com/tools/support-library/index.html

For more information about NaigationDrawer

http://developer.android.com/training/implementing-navigation/nav-drawer.html

+8
source

Yes, I completely agree with @Raghunandan, when we work with the navigation box, we need to use the latest support library

And when we work with ActionBar Sherlock Navigation Drawer, we need to use some import data in our program, see below:

 import android.support.v4.app.ActionBarDrawerToggle; import android.support.v4.widget.DrawerLayout; import android.support.v4.view.GravityCompat; import com.actionbarsherlock.app.SherlockFragmentActivity; import com.actionbarsherlock.view.MenuItem; 
+2
source

Source: https://habr.com/ru/post/954317/


All Articles