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 7174541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:04:37+00:00 2026-05-28T16:04:37+00:00

I have a ViewPager with 3 pages. In each page, I would like to

  • 0

I have a ViewPager with 3 pages. In each page, I would like to insert a listview which is populated in seperate classes. Now, I found the simplest method is by inflate layouts which has a fragment in it. Lets say I have 3 pages.
In page 1 I inflate a layout with fragment1, in page 2 I inflate a layout with fragment2, and in page 3 I inflate a layout with fragment3. How do I assign activities as the fragments contents? I have been searching through the internet for tutorials but none really fits my needs. Or are there any better way to achieve my goal?

Illustration:
enter image description here

Activity 1 2 and 3 are all ListViews. The inflate custom layouts as their itemslayout.

  • 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-05-28T16:04:38+00:00Added an answer on May 28, 2026 at 4:04 pm

    How do I assign activities as the fragments contents?

    You don’t. Activities hold fragments, not the other way around.

    Or are there any better way to achieve my goal?

    Use a ListFragment for each page of your ViewPager. Beyond that, you have not explained what your goal is, and therefore it is difficult to assist you further.

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

Sidebar

Related Questions

I have a view pager with four pages, and each page have a listView.
I have a viewpager including 3 pages. I set one viewgroup in each page
In my small Android app, I have a ViewPager with 3 pages, each page
I have a ViewPager with a dynamic number of pages in it. Each of
If I have a viewpager where each page is a fragment. And some of
I have a viewpager with 2 pages, on each fragment i put a button
If I have a ViewPager with a certain number of pages, what would be
I have a ViewPager which has 4 pages and I want it scroll automatically.
I have a ViewPager that uses ListFragments on each page. I implement onListItemClick and
I have this structure: Activity A has a ViewPager. The pages of a ViewPager

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.