title: Setting own ViewPager error
body: <p>So I am using fragments and as I want to disable swiping mode in the application I am trying to use the <code>CustomViewPager</code> as suggested here: <a href="https://stackoverflow.com/questions/16342630/how-to-disable-viewpager-adapter-on-touching-specific-views">how to disable viewpager adapter on touching specific views?</a> and here: <a href="https://stackoverflow.com/questions/11498402/how-to-disable-viewpager-swiping-using-android-support-v4-jar-in-android">how to disable ViewPager swiping using android-support-v4.jar in android</a>.
  Tried to follow this but with no luck. What I am trying to achieve is that on the button click application will not follow swpie gestures between fragments. For now, even if I disable swiping on startup it is all fine.</p>
  
  <p>Used snippet:</p>
  
  <pre><code>package com.receive.bluereceive;
  
  public class Main extends android.support.v4.app.FragmentActivity implements ActionBar.TabListener {
  
  private AppSectionsPagerAdapter mAppSectionsPagerAdapter;
  private CustomViewPager mViewPager;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main_activity);
  
      final ActionBar actionBar = getActionBar();
      actionBar.setHomeButtonEnabled(false);
      actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
      mAppSectionsPagerAdapter = new AppSectionsPagerAdapter(getSupportFragmentManager());        
  
  
      mViewPager = (CustomViewPager) findViewById(R.id.pager);
  
      mViewPager.setAdapter(mAppSectionsPagerAdapter);
  
      mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
          @Override
          public void onPageSelected(int position) {
              // When swiping between different app sections, select the corresponding tab.
              // We can also use ActionBar.Tab#select() to do this if we have a reference to the
              // Tab.
              actionBar.setSelectedNavigationItem(position);
          }
      });
  
  
      for (int i = 0; i &lt; mAppSectionsPagerAdapter.getCount(); i++) {
          // Create a tab with text corresponding to the page title defined by the adapter.
          // Also specify this Activity object, which implements the TabListener interface, as the
          // listener for when this tab is selected.
          actionBar.addTab(
                  actionBar.newTab()
                          .setText(mAppSectionsPagerAdapter.getPageTitle(i))
                          .setTabListener(this));
      }   
  }
  
  public class CustomViewPager extends ViewPager{
  
      public CustomViewPager(Context context){
          super(context);
      }
  
      public CustomViewPager(Context context, AttributeSet attrs) {
          super(context, attrs);
      }
  
      @Override
      public boolean onInterceptTouchEvent(MotionEvent ev){
          return false;
      }
  
      @Override
      public boolean onTouchEvent(MotionEvent ev){
          return false;
      }
  }
  }
  </code></pre>
  
  <p>Here is the .xml of the <code>CustomViewPager</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;com.receive.bluereceive.CustomViewPager xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/pager"
  android:layout_width="match_parent"
  android:layout_height="match_parent" /&gt;
  </code></pre>
  
  <p>And lastly, the error I am getting:</p>
  
  <pre><code>01-15 03:06:14.482: E/AndroidRuntime(29489): FATAL EXCEPTION: main
  01-15 03:06:14.482: E/AndroidRuntime(29489): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.receive.bluereceive/com.receive.bluereceive.Main}: android.view.InflateException: Binary XML file line #2: Error inflating class com.receive.bluereceive.CustomViewPager
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2308)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2358)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at android.app.ActivityThread.access$600(ActivityThread.java:153)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at android.os.Handler.dispatchMessage(Handler.java:99)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at android.os.Looper.loop(Looper.java:137)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at android.app.ActivityThread.main(ActivityThread.java:5227)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at java.lang.reflect.Method.invokeNative(Native Method)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at java.lang.reflect.Method.invoke(Method.java:511)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at dalvik.system.NativeStart.main(Native Method)
  01-15 03:06:14.482: E/AndroidRuntime(29489): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class com.receive.bluereceive.CustomViewPager
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:323)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at android.app.Activity.setContentView(Activity.java:1881)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at com.receive.bluereceive.Main.onCreate(Main.java:101)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at android.app.Activity.performCreate(Activity.java:5104)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2262)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    ... 11 more
  01-15 03:06:14.482: E/AndroidRuntime(29489): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.receive.bluereceive.CustomViewPager" on path: /data/app/com.receive.bluereceive-2.apk
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at android.view.LayoutInflater.createView(LayoutInflater.java:552)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
  01-15 03:06:14.482: E/AndroidRuntime(29489):    ... 20 more
  </code></pre>
  
  <p>What is causing the trouble? I have no idea what I am doing wrong here. Would be glad if I start the application anyhow...</p>