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

  • SEARCH
  • Home
  • 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 5989065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:02:52+00:00 2026-05-22T23:02:52+00:00

So I have a class that gets items from a database and then places

  • 0

So I have a class that gets items from a database and then places them into a layout and inflates. This loops through each item in the database inflating a new layout for each item. This eventually extends past the viewport and will need a scroll bar which I assume will be a ScrollView. I’ve tried many different ways and can’t get it to scroll through the entire content. Please advise.

Java:

View myView = linflater.inflate(R.layout.myviews, null);

TextView tvQuote = (TextView) myView.findViewById(R.id.lblQuote);
//Set an id to know which quote is in use
tvQuote.setId(i);
TextView tvShared = (TextView) myView.findViewById(R.id.lblShared);
TextView tvSaid = (TextView) myView.findViewById(R.id.lblSaid);

//Change name dynamically
tvQuote.setText((strQuote).toString());
tvShared.setText(("Shared by: " + strFName + " " + strLInitial).toString());
tvSaid.setText(("Said by: " + strFNameSaid + " " + strLInitialSaid).toString());

main.xml:

<?xml version="1.0" encoding="utf-8"?>
    <LinearLayout 
        android:orientation="vertical" 
        android:id="@+id/myMainLayout" 
        android:layout_width="fill_parent" 
        xmlns:android="http://schemas.android.com/apk/res/android" 
        android:layout_height="wrap_content">   
    <TextView 
        android:layout_height="wrap_content" 
        android:layout_width="fill_parent" 
        android:text="Quoter" 
        android:id="@+id/lblTitle" 
        android:textSize="16px" 
        android:padding="5px" 
        android:textStyle="bold" 
        android:gravity="center_horizontal">
    </TextView>
</LinearLayout>

myviews.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">


        <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1">

            <TextView 
                android:id="@+id/lblQuote" 
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content"
                android:layout_weight="1"/>
        </LinearLayout>

        <LinearLayout 
            android:orientation="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1">

            <TextView 
                android:id="@+id/lblShared" 
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content"
                android:layout_weight="1"/>
            <TextView 
                android:id="@+id/lblSaid" 
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content"
                android:layout_weight="1"/> 
        </LinearLayout>
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1">
          <TextView
            android:text=" "
            android:textSize="1pt"
            android:background="#6F7285"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"/>     
        </LinearLayout>
</LinearLayout>

What would be the best solution to scroll through all of these inflated layouts?

  • 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-22T23:02:52+00:00Added an answer on May 22, 2026 at 11:02 pm

    I actually found that adding the ScrollView to the main.xml was the fix. Thanks for all your help though guys. I’d still like to know if I am doing this wrong though.

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

Sidebar

Related Questions

I have a fairly simple web application that gets a list of items from
I have a C++ template class that gets instantiated with 3 different type parameters.
I have a class that looks like this public class SomeClass { public SomeChildClass[]
I have an app that hits a REST service, gets some json and then
In a current project, I have a model called Box that stores items from
I have class method that returns a list of employees that I can iterate
I have a class that I want to use to store properties for another
I have a class that map objects to objects, but unlike dictionary it maps
I have a class that I wish to expose as a remote service using
I have a class that creates several IDisposable objects, all of these objects are

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.