Android Fragments - What am I doing wrong
<p>I'm trying to make moving pictures (using your finger) + ViewPagerIndicator (dots)</p>

<p>The problem is that I do not want to start. Something he does not fit in the layout this line is 17</p>

<pre><code>android:name=".PlaceSlideFragment"
</code></pre>

<p>PlaceDetailsFragment</p>

<pre><code>public class PlaceDetailsFragment extends SherlockFragment {
    PlaceSlidesFragmentAdapter mAdapter;
    ViewPager mPager;
    PageIndicator mIndicator;

    public static final String TAG = "detailsFragment";

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.main,
                container, false);

        mAdapter = new PlaceSlidesFragmentAdapter(getActivity()
                .getSupportFragmentManager());

        mPager = (ViewPager) view.findViewById(R.id.pager);
        mPager.setAdapter(mAdapter);

        mIndicator = (CirclePageIndicator) view.findViewById(R.id.indicator);
        mIndicator.setViewPager(mPager);
        ((CirclePageIndicator) mIndicator).setSnap(true);

        mIndicator
                .setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
                    @Override
                    public void onPageSelected(int position) {
                        Toast.makeText(PlaceDetailsFragment.this.getActivity(),
                                "Changed to page " + position,
                                Toast.LENGTH_SHORT).show();
                    }

                    @Override
                    public void onPageScrolled(int position,
                            float positionOffset, int positionOffsetPixels) {
                    }

                    @Override
                    public void onPageScrollStateChanged(int state) {
                    }
                });
        return view;
    }

}
</code></pre>

<p>PlaceSlideFragment</p>

<pre><code>public final class PlaceSlideFragment extends Fragment {
    int imageResourceId;

    public PlaceSlideFragment(int i) {
        imageResourceId = i;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {

        ImageView image = new ImageView(getActivity());
        image.setImageResource(imageResourceId);

        LinearLayout layout = new LinearLayout(getActivity());
        layout.setLayoutParams(new LayoutParams(null));

        layout.setGravity(Gravity.CENTER);
        layout.addView(image);

        return layout;
    }
}
</code></pre>

<p>PlaceSlidesFragmentAdapter</p>

<pre><code>public class PlaceSlidesFragmentAdapter extends FragmentPagerAdapter implements
IconPagerAdapter {

private int[] Images = new int[] { R.drawable.real_pixels, R.drawable.real_pixels,
    R.drawable.real_pixels, R.drawable.real_pixels

};

protected static final int[] ICONS = new int[] { R.drawable.ic_launcher,
    R.drawable.ic_launcher, R.drawable.ic_launcher, R.drawable.ic_launcher };

private int mCount = Images.length;

public PlaceSlidesFragmentAdapter(FragmentManager fm) {
super(fm);
}

@Override
public Fragment getItem(int position) {
return new PlaceSlideFragment(Images[position]);
}

@Override
public int getCount() {
return mCount;
}

@Override
public int getIconResId(int index) {
return ICONS[index % ICONS.length];
}

public void setCount(int count) {
if (count &gt; 0 &amp;&amp; count &lt;= 10) {
    mCount = count;
    notifyDataSetChanged();
}
}
}
</code></pre>

<p>MainActivity</p>

<pre><code>public class MainActivity extends FragmentActivity{
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }


}
</code></pre>

<p>main(layout)</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" &gt;

    &lt;android.support.v4.view.ViewPager
        android:id="@+id/pager"
        android:layout_width="fill_parent"
        android:layout_height="200dp" /&gt;

    &lt;com.viewpagerindicator.CirclePageIndicator
        android:id="@+id/indicator"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="10dip" /&gt;

    &lt;fragment   
            android:name=".PlaceSlideFragment"
            android:id="@+id/fragment"
            android:layout_width="match_parent"
            android:layout_height="match_parent" /&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p>LogCat</p>

<pre><code>02-03 11:06:18.963: E/AndroidRuntime(10993): FATAL EXCEPTION: main
02-03 11:06:18.963: E/AndroidRuntime(10993): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test/com.test.MainActivity}: android.view.InflateException: Binary XML file line #17: Error inflating class fragment
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.app.ActivityThread.access$600(ActivityThread.java:141)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.os.Handler.dispatchMessage(Handler.java:99)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.os.Looper.loop(Looper.java:137)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.app.ActivityThread.main(ActivityThread.java:5039)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at java.lang.reflect.Method.invokeNative(Native Method)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at java.lang.reflect.Method.invoke(Method.java:511)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at dalvik.system.NativeStart.main(Native Method)
02-03 11:06:18.963: E/AndroidRuntime(10993): Caused by: android.view.InflateException: Binary XML file line #17: Error inflating class fragment
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.app.Activity.setContentView(Activity.java:1881)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at com.test.MainActivity.onCreate(MainActivity.java:16)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.app.Activity.performCreate(Activity.java:5104)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
02-03 11:06:18.963: E/AndroidRuntime(10993):    ... 11 more
02-03 11:06:18.963: E/AndroidRuntime(10993): Caused by: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment .PlaceSlideFragment: make sure class name exists, is public, and has an empty constructor that is public
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.support.v4.app.Fragment.instantiate(Fragment.java:391)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.support.v4.app.Fragment.instantiate(Fragment.java:359)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:262)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
02-03 11:06:18.963: E/AndroidRuntime(10993):    ... 21 more
02-03 11:06:18.963: E/AndroidRuntime(10993): Caused by: java.lang.ClassNotFoundException: Didn't find class ".PlaceSlideFragment" on path: /data/app/com.test-1.apk
02-03 11:06:18.963: E/AndroidRuntime(10993):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
02-03 11:06:18.963: E/AndroidRuntime(10993):    at android.support.v4.app.Fragment.instantiate(Fragment.java:381)
</code></pre>
