Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8010437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:44:06+00:00 2026-06-04T18:44:06+00:00

I am preparing the Swipe by using ViewPager. In my application display the 4

  • 0

I am preparing the Swipe by using ViewPager. In my application display the 4 ListActivities by using ViewPager.I Know how to add the views in ViewPager but I dont Know how to add the ListActivity in my app.
Please help me………………

    private class MyPagerAdapter extends PagerAdapter {

    private ArrayList<LinearLayout> views;

    public MyPagerAdapter(Context context) {

        views = new ArrayList<LinearLayout>();
        views.add(new ListView1Page(context));
        views.add(new TextViewPage(context));
        views.add(new ListView2Page(context));
        views.add(new ButtonPage(context));

    }

    @Override
    public void destroyItem(View view, int arg1, Object object) {
        ((ViewPager) view).removeView((LinearLayout) object);
    }

    @Override
    public void finishUpdate(View arg0) {

    }

    @Override
    public int getCount() {
        return views.size();
    }

    @Override
    public Object instantiateItem(View view, int position) {
        LinearLayout myView = views.get(position);
        ((ViewPager) view).addView(myView);//addView(myView);
        return myView;

    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return view == object;
    }

    @Override
    public void restoreState(Parcelable arg0, ClassLoader arg1) {

    }

    @Override
    public Parcelable saveState() {
        return null;
    }

    @Override
    public void startUpdate(View arg0) {

    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:44:07+00:00Added an answer on June 4, 2026 at 6:44 pm

    I’m not sure about activities, but you can use fragments instead. Take a look into FragmentPagerAdapter and FragmentStatePagerAdapter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am preparing a registration page using JSF/Spring webflow&mvc application. I have added two
I am preparing an application for Android which will display current status of some
I'm preparing a query for mySQL to grab record from the previous week, but
I am preparing android application which is showing the following error: 03-21 17:30:41.988: E/AndroidRuntime(782):
I'm preparing a set of reports using open source ReportLab. The reports contain a
I am preparing a script. I am using AJAX(load()) with jQuery. I am getting
CONTEXT: I am preparing a big C# merge using visual studio 2008 and TFS.
I'm preparing a presentation about JavaScript in different browsers. I know that there are
While preparing my phone app for release, I thought I'd change the version numbers
Im preparing website page structure but stuck here Html <div id=main> <div id=left></div> <div

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.