Note that there are some explanatory texts on larger screens.

plurals
  1. POThe method create(int) is undefined for the type ScreenSlideActivity.ScreenSlidePagerAdapter
    primarykey
    data
    text
    <p>I am also trying to implement <a href="http://developer.android.com/training/animation/screen-slide.html" rel="nofollow noreferrer">this project</a> and i am getting ^Title^ error.</p> <p>I know this error has been re-posted. see here: <a href="https://stackoverflow.com/questions/14950833/error-the-constructor-mainactivity-screenslidepageradapterfragmentmanager-is">Error: The constructor MainActivity.ScreenSlidePagerAdapter(FragmentManager) is undefined</a> and here: <a href="https://stackoverflow.com/questions/14114745/eclipse-doesnt-recognize-android-support-v13-app-fragmentactivity-although-i-hav">Eclipse doesnt recognize android.support.v13.app.FragmentActivity although I have android-support-v13 library</a></p> <p>but none of the answers solved my problem. Maybe there something wrong with the libraries or??</p> <p>Here is my code.</p> <pre><code>package kn.screenslide; import android.app.Fragment; import android.app.FragmentManager; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentStatePagerAdapter; import android.support.v4.app.FragmentActivity; import android.support.v4.app.NavUtils; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.view.Menu; import android.view.MenuItem; public class ScreenSlideActivity extends FragmentActivity { //The number of pages (wizard steps) to show in this demo. private static final int NUM_PAGES = 5; //The pager widget, which handles animation and allows swiping horizontally to access previous and next wizard steps. private ViewPager mPager; //The pager adapter, which provides the pages to the view pager widget. private PagerAdapter mPagerAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_screen_slide); // Instantiate a ViewPager and a PagerAdapter. mPager = (ViewPager) findViewById(R.id.pager); mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager()); mPager.setAdapter(mPagerAdapter); mPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { @Override public void onPageSelected(int position) { // When changing pages, reset the action bar actions since they are dependent // on which page is currently active. An alternative approach is to have each // fragment expose actions itself (rather than the activity exposing actions), // but for simplicity, the activity provides the actions in this sample. invalidateOptionsMenu(); } }); } //A simple pager adapter that represents 5 {@link ScreenSlidePageFragment} objects, in sequence. private class ScreenSlidePagerAdapter extends FragmentStatePagerAdapter { public ScreenSlidePagerAdapter(android.support.v4.app.FragmentManager fm) { super(fm); } //This is where fragments are created @Override public android.support.v4.app.Fragment getItem(int position) { return ScreenSlidePageAdapter.create(position); } @Override public int getCount() { return NUM_PAGES; } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload