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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:01:35+00:00 2026-06-11T05:01:35+00:00

I have a simple question, I know you can use: setListAdapter(new ArrayAdapter<String> (getActivity(), R.layout.your_layout,

  • 0

I have a simple question, I know you can use:

setListAdapter(new ArrayAdapter<String> (getActivity(), 
                R.layout.your_layout,
                R.id.your_text,
                stringArray));  

inside a ListFragment on your onActivityCreated() method. This works well for me so far, but only covers one item. For instance, say if in the the layout, I had two TextViews: sms_text, and sms_timestamp; both to be filled by smsTextArray [] and smsTimeStampArray [] respectively. How would that call be? I tried:

setListAdapter(new ArrayAdapter<String> (getActivity(), 
                R.layout.tweet_list_item,
                R.id.sms_text,
                smsTextArray,
                R.id.sms_timestamp,
                smsTimeStampArray,
                ));     

That did not work 🙁

I also tried calling setListAdapter() twice in the same onActivityCreated(), but although that worked, it only displayed the second call of setListAdapter() in the list items.

I also tried creating my own Adapter but I kind of got lost in that mess. Can you guys point me in the right direction? I do not need the exact code, just a link to a library I could read, or perhaps it is a simple as just a code call. Who knows, maybe I am just using the wrong parameters, any ideas?

  • 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-11T05:01:37+00:00Added an answer on June 11, 2026 at 5:01 am

    You can’t use a simple ArrayAdapter and display more than one piece of data. An adapter maps one element in the list to one element in the listView. To have data come from two different pieces you need to either create your own adapter (simpler than it sounds). Or alternatively you can use a list of Maps in a SimpleAdapter (see this for an example).

    Personally, I’d recommend going for the custom Adapter. You’re going to have to code one eventually, and there’s no time like the present. Plus, you’re code will be more readable and obvious.

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

Sidebar

Related Questions

I have what I know is a simple question, but after many searches in
I know it's a simple question, but I have strange behaviour in here. <pre>
I know this is a simple question for someone out there, but I have
I have simple type Question : public class Question { public string[] Tags {
This is a simple question: I know and have heard from almost everyone that
I have a simple question. I know that shell scripts are slow/ineffective when it
i have a (hopefully) simple question: Can i modify a xml file located in
I know since the 3.0 SDK we can use accessories, so my question is
I have this simple question actually but I can't find the correct answer. I
I know we can use functions in SQL Server, but my question here: If

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.