title: error -Didn't find class "android.support.v4.widget
body: <p>this is my main activity.xml</p>
  
  <p>`    
      </p>
  
  <pre><code>          &lt;android.support.v4.widget.
          android:id="@+id/drawer_layout"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
  
          &lt;FrameLayout android:layout_width="wrap_content"
                       android:layout_height="match_parent"&gt;
  
  
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:paddingBottom="@dimen/activity_vertical_margin"
              android:paddingLeft="@dimen/activity_horizontal_margin"
              android:paddingRight="@dimen/activity_horizontal_margin"
              android:paddingTop="@dimen/activity_vertical_margin
  
              &lt;android.support.v7.widget.Toolbar
                  android:id="@+id/toolbar"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
                  app:theme="@style/Theme.AppCompat.Light.DarkActionBar"/&gt;
  
          &lt;/FrameLayout&gt;
  
          &lt;fragment
              android:id="@+id/fragment.navigation.drawer"
              android:name="piestudio.zine.NavigationDrawerFragment"
              android:layout_width="280dp"
              android:layout_height="match_parent"
              android:layout_gravity="start"
              app:layout="@layout/fragment_navigation_drawer"
              tools:layout="@layout/fragment_navigation_drawer"/&gt;
  
  
  
      &lt;/android.support.v4.widget.&gt;
  
  
  
  &lt;/LinearLayout&gt; 
  </code></pre>
  
  <p>`</p>
  
  <p>main activity.java</p>
  
  <p>`    package piestudio.zine;</p>
  
  <pre><code>import android.os.Bundle;
  import android.support.v4.widget.DrawerLayout;
  import android.support.v7.app.AppCompatActivity;
  import android.view.Menu;
  
  public class MainActivity extends AppCompatActivity{
      public boolean onCreateOptionsMenu(Menu menu) {
          getMenuInflater().inflate(R.menu.drawer,menu);
          return true;
      }
  
      public android.support.v7.widget.Toolbar toolbar;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main_appbar);
  
          toolbar = (android.support.v7.widget.Toolbar) findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
          getSupportActionBar().setDisplayShowHomeEnabled(true);
  
  
  
         NavigationDrawerFragment drawerFragment = (NavigationDrawerFragment)
                 getSupportFragmentManager().findFragmentById(R.id.fragment_navigation_drawer);
          drawerFragment.setUP(R.id.fragment_navigation_drawer,(DrawerLayout) findViewById(R.id.drawer_layout),toolbar);}
  
  
  
  }
  </code></pre>
  
  <p>`</p>
  
  <p>navigation drawer activity </p>
  
  <p>`    package piestudio.zine;</p>
  
  <pre><code>import android.content.Context;
  import android.content.SharedPreferences;
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.support.v4.widget.DrawerLayout;
  import android.support.v7.app.ActionBarDrawerToggle;
  import android.support.v7.widget.Toolbar;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  
  
  /**
   * A simple {@link Fragment} subclass.
   */
  public class NavigationDrawerFragment extends Fragment {
  
      public static final String PREF_FILE_NAME = "testpref";
      public static final String KEY_USER_LEARNED_DRAWER="user_learned_drawer";
      private ActionBarDrawerToggle mDrawerToggle;
      private DrawerLayout mDrawerLayout;
      private View containerView;
      private boolean mUserLearnedDrawer;
      private boolean mFromSavedInstanceState;
  
  
      public NavigationDrawerFragment() {
  
  
          // Required empty public constructor
      }
  
      @Override
      public void onCreate( Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
         mUserLearnedDrawer=Boolean.valueOf(readFromPreferences(getActivity(),KEY_USER_LEARNED_DRAWER,"false"));
          if(savedInstanceState!=null){
  
              mFromSavedInstanceState=true;
          }
  
  
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          // Inflate the layout for this fragment
          return inflater.inflate(R.layout.fragment_navigation_drawer, container, false);
  
      }
  
  
      public void setUP(int fragmentId, DrawerLayout drawerLayout, final Toolbar toolbar) {
          containerView=getActivity().findViewById(fragmentId);
  
          mDrawerLayout = drawerLayout;
          mDrawerToggle = new ActionBarDrawerToggle(getActivity(), drawerLayout, toolbar, R.string.drawer_open, R.string.drawer_close) {
  
              @Override
              public void onDrawerOpened(View drawerView) {
                  super.onDrawerOpened(drawerView);
  
                  if (mUserLearnedDrawer){
                      mUserLearnedDrawer=true;
                      saveToPreferences(getActivity(),KEY_USER_LEARNED_DRAWER,mUserLearnedDrawer+"");
                  }
  
                  getActivity().invalidateOptionsMenu();
              }
  
              @Override
              public void onDrawerClosed(View drawerView) {
                  super.onDrawerClosed(drawerView);
                  getActivity().invalidateOptionsMenu();
  
  
              }
  
              @Override
              public void onDrawerSlide(View drawerView, float slideOffset) {
                  if (slideOffset&lt;0.8){
                  toolbar.setAlpha(1-slideOffset);}
              }
          };
  
          if (!mUserLearnedDrawer&amp;&amp;!mFromSavedInstanceState){
  
  
              mDrawerLayout.openDrawer(containerView);
  
          }
          mDrawerLayout.setDrawerListener(mDrawerToggle);
          mDrawerLayout.post(new Runnable() {
              @Override
              public void run() {
                  mDrawerToggle.syncState();
  
              }
          });
  
  
      }
  
  
      public static void saveToPreferences(Context context, String preferenceName, String preferenceValue) {
  
          SharedPreferences sharedPreferences = context.getSharedPreferences(PREF_FILE_NAME, Context.MODE_PRIVATE);
          SharedPreferences.Editor editor = sharedPreferences.edit();
          editor.putString(preferenceName, preferenceValue);
          editor.apply();
      }
  
      public static String readFromPreferences(Context context, String preferenceName, String defaultValue) {
  
          SharedPreferences sharedPreferences = context.getSharedPreferences(PREF_FILE_NAME, Context.MODE_PRIVATE);
          return sharedPreferences.getString(preferenceName,defaultValue);
      }
  
  } 
  </code></pre>
  
  <p>`</p>
  
  <p>logcat of error</p>
  
  <p><code>Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class android.support.v4.widget.
                                                                        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
                                                                        at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
                                                                        at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
                                                                        at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
                                                                        at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
                                                                        at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:276)
                                                                        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:136)
                                                                        at piestudio.zine.MainActivity.onCreate(MainActivity.java:21)
                                                                        at android.app.Activity.performCreate(Activity.java:5133)
                                                                        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
                                                                        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
                                                                        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261) 
                                                                        at android.app.ActivityThread.access$600(ActivityThread.java:141) 
                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) 
                                                                        at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                                        at android.os.Looper.loop(Looper.java:137) 
                                                                        at android.app.ActivityThread.main(ActivityThread.java:5103) 
                                                                        at java.lang.reflect.Method.invokeNative(Native Method) 
                                                                        at java.lang.reflect.Method.invoke(Method.java:525) 
                                                                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 
                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
                                                                        at dalvik.system.NativeStart.main(Native Method) 
                                                                     Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.widget." on path: DexPathList[[zip file "/data/app/piestudio.zine-1.apk"],nativeLibraryDirectories=[/data/app-lib/piestudio.zine-1, /system/lib]]
                                                                        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
                                                                        at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
                                                                        at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
                                                                        at android.view.LayoutInflater.createView(LayoutInflater.java:559)
                                                                        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
                                                                        at android.view.LayoutInflater.rInflate(LayoutInflater.java:755) 
                                                                        at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
                                                                        at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 
                                                                        at android.view.LayoutInflater.inflate(LayoutInflater.java:353) 
                                                                        at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:276) 
                                                                        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:136) 
                                                                        at piestudio.zine.MainActivity.onCreate(MainActivity.java:21) 
                                                                        at android.app.Activity.performCreate(Activity.java:5133) 
                                                                        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 
                                                                        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175) 
                                                                        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261) 
                                                                        at android.app.ActivityThread.access$600(ActivityThread.java:141) 
                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) 
                                                                        at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                                        at android.os.Looper.loop(Looper.java:137) 
                                                                        at android.app.ActivityThread.main(ActivityThread.java:5103) 
                                                                        at java.lang.reflect.Method.invokeNative(Native Method) 
                                                                        at java.lang.reflect.Method.invoke(Method.java:525) 
                                                                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 
                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
                                                                        at dalvik.system.NativeStart.main(Native Method) 
  </code></p>
  
  <p>my app is not starting and giving me force close everytime i run it in emulator . please help me out . i am doing all this to get items (list) on navigation drawer you can also point out any mistake in the code :). though the logcat is showing the error of ## -Didn't find class "android.support.v4.widget. ## i am not able to solve this error</p>