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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:43:41+00:00 2026-05-14T14:43:41+00:00

I have a web service that returns a super simple list of objects MyObject[]

  • 0

I have a web service that returns a super simple list of objects

MyObject[] data = webServiceCall();

MyObject has 1 field i want to display, "Name" (i.e. data[0].Name )

How can i turn this into an activity that lists just the name of these objects in a scrollable listActivity on Android. I am getting really confused with Cursors and am not sure if I need Cursors and I”m not sure what kind of adapter to implement (BaseAdapter, SimpleAdapter etc)

So i guess i’m looking for three things,

the activity, the adapter and the layout.xml

Just trying to figure this android stuff out, definitely a noob here

  • 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-14T14:43:41+00:00Added an answer on May 14, 2026 at 2:43 pm

    so i think i figured it out with a little inspiration from RobGThai’s answer, i’m posting the code for anyone else to see, i guess i didn’t really use a custom adapter

    This is the super simple example that got me started, so once i had this, I made sure my “MyObject” had a toString() method on it to show properly in the list and i passed the MyObject[] array into the “new ArrayAdapter” constructor instead of listItems

    FooList.java

    import android.app.ListActivity;
    import android.os.Bundle;
    import android.widget.ArrayAdapter;
    
    public class FooList extends ListActivity {
        String[] listItems = {"item 1", "item 2 ", "list", "android", "item 3", "foobar", "bar", }; 
        @Override
         public void onCreate(Bundle savedInstanceState) {
             super.onCreate(savedInstanceState);
             setContentView(R.layout.temp);
             setListAdapter(new ArrayAdapter(this,  android.R.layout.simple_list_item_1, listItems));
         }
    
    }
    

    the layout xml i used (temp.xml)

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical" android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <ListView android:id="@android:id/list" android:layout_width="fill_parent"
            android:layout_height="wrap_content" />
        <TextView android:id="@android:id/empty" android:layout_width="wrap_content"
            android:layout_height="wrap_content" android:text="Empty set" />
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web service which has a generic function that returns a dataset
I have a web service that queries data from this json file, but I
I have a JAX-RPC (Java) web service that needs to return a complex polymorphic
I have a web-service that I will be deploying to dev, staging and production.
I have a web service that I created in C# and a test harness
I have a web service that uses Python's SimpleJSON to serialize JSON, and a
I have a web service that is protected by requiring the consuming third party
I have a web service that needs different settings for different environments (debug, test,
I have a web service that I can only hit if I'm logged into
I have a listview that's populated by rows that get their data from a

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.