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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:35:41+00:00 2026-06-14T14:35:41+00:00

I have a list view which is shown on a fragment. I have a

  • 0

I have a list view which is shown on a fragment. I have a button at the bottom of the screen in which when pressed, will call a webservice to reteive any additional data. If there is additional data, I need to add it to the list view. I have searched this forum and so many other web sites to try and find how to do it, but I have had no success. Any help is much appreciated.

I am now thinking do I need to add the fragment dyncamically instead of having it defined on the following XML layout.

I am using a ListFragment to inflate a list view on the screen.

I have a screen with two fragments on it. The XML for the screen is below: –

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

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

        <fragment
            android:name="atos.mobilereporting.com.ReportList"
            android:layout_width="323dp"
            android:layout_height="match_parent" />

        <fragment
            android:name="atos.mobilereporting.com.ReportDetail"
            android:layout_width="958dp"
            android:layout_height="match_parent" />
    </LinearLayout>


    <Button
        android:id="@+id/getReports"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Refresh Mobile Reports" />

</LinearLayout>

The code to inflate the view is below: –

 public class ReportList extends ListFragment {

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

            // Get list of reports...
            repList = ReportDefinitionFactory.buildReportList(3);

            activity = getActivity();

            ListAdapter la = new ArrayAdapter<String>(getActivity(),
                    android.R.layout.simple_list_item_1,
                    ReportDefinitionFactory.getReportDescriptions(repList));

            setListAdapter(la);

        }

    }

This code shows a simple list view with 3 rows on it.

It is at this point I must stop as I do not know were to go from here. I have the code which will add an additional row to the array that is used to initially build the list view, but I do not know how I can invoke a refresh on the list view.

Thanks

Martin

  • 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-14T14:35:42+00:00Added an answer on June 14, 2026 at 2:35 pm

    You need to call la.notifyDataSetChanged() to force refresh of the list once the data has changed.

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

Sidebar

Related Questions

I have a list view item which has a button and displays properties on
I have a list view which contains a button in each row of the
I have a view called, clients which shows a list of calls from the
I have a list view which is bound to a DataTable source. The sorting
I have chat list view in which sender name should be left aligned and
I have a basic iPhone/iPad app which has a ; a. List view &
I have created a view which contains both Javascript and functions as shown: @functions
I have created a list view which contains a list of images defined by
I have an expandable list view I am using in one xml file which
I have a View in which the user can choose any number of Clubs

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.