OK. I have seen many questions along these lines, but it's possible that my issue is so basic (i.e. stupid n00b question), that no one has bothered to ask.
I'm still very new to Android programming, or using Java in an "industrial" capacity (i.e. not for simple 10-line classroom problems).
I have an activity class with an embedded static class:
package com.example.android.effectivenavigation;
•
•
•
public class MainActivity extends FragmentActivity implements ActionBar.TabListener {
•
•
•
public static class NonSwipeableViewPager extends ViewPager {
•
•
•
}
}
This comes from a sample from this site. What I am trying to do, is reduce it to the most basic, atomic elements.
Specifically, I want to have the entire example in the main activity file.
Here is my (non-funtional) XML:
<com.example.android.effectivenavigation.MainActivity.NonSwipeableViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Now, the problem is that when I specify the ViewPager in the layout XML, I get a "ClassNotFoundException" when it comes time to unwrap the NonSwipeableViewPager element.
It works fine if I set the NonSwipeableViewPager up in a separate file and reference it fairly directly. It's when it's embedded as a static class into the main activity class that I have issues.
I'm obviously using the wrong namespace in the XML.
Can anyone help me to find the correct namespace to use?
Thanks!