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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:21:52+00:00 2026-05-31T20:21:52+00:00

I want to fill a ListView without an array of all the same things.

  • 0

I want to fill a ListView without an array of all the same things.

I have a class “TijdsregistratieKaart” with these strings, boolean & double.

public class TijdsregistratieKaart {
  public String date,customerName,description,startTime,stopTime,taskDocumentNo_,activity,project,internalInformation,externalInformation;
  public Boolean coaching;
  public double percentageComplete;
  ...
}

now my question is how to i put all these things in a listview.
so that Date is in a different cell than customerName & description,… I can’t find an example of a listview without using an array of all the same strings or double’s or…

At the moment i got an TijdsregistratieKaartAdapter class en fill my listView like this:

private class tijdsregistratieKaartAdapter extends ArrayAdapter<TijdsregistratieKaart> {

    private ArrayList<TijdsregistratieKaart> items;

    public tijdsregistratieKaartAdapter(Context context, int textViewResourceId,
            ArrayList<TijdsregistratieKaart> items) {
        super(context, textViewResourceId, items);
        this.items = items;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View v = convertView;
        if (v == null) {
            LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v = vi.inflate(R.layout.tijdsregistratiekaartrij, null);
        }
        TijdsregistratieKaart tijdsregistratiekaart = items.get(position);
        if (tijdsregistratiekaart != null) {
            TextView at = (TextView) v.findViewById(R.id.TRKtxtDatum);
            TextView bt = (TextView) v.findViewById(R.id.TRKtxtKlantNaam);
            TextView ct = (TextView) v.findViewById(R.id.TRKtxtDescription);
            TextView dt = (TextView) v.findViewById(R.id.TRKtxtTaskDocNo);
            TextView et = (TextView) v.findViewById(R.id.TRKtxtActivity);
            TextView ft = (TextView) v.findViewById(R.id.TRKtxtCoaching);
            TextView gt = (TextView) v.findViewById(R.id.TRKtxtExternalInformation);
            TextView ht = (TextView) v.findViewById(R.id.TRKtxtInternalInformation);
            TextView it = (TextView) v.findViewById(R.id.TRKtxtPercentageComplete);
            TextView jt = (TextView) v.findViewById(R.id.TRKtxtProject);
            TextView kt = (TextView) v.findViewById(R.id.TRKtxtStartTime);
            TextView lt = (TextView) v.findViewById(R.id.TRKtxtStopTime);
            if (at != null) {
                at.setText("Datum:\n" + tijdsregistratiekaart.date);
            }
            if (bt != null) {
                bt.setText("Klant naam:\n " + tijdsregistratiekaart.customerName);
            }
            if (ct != null) {
                ct.setText("Omschrijving:\n " + tijdsregistratiekaart.description);
            }
            if (dt != null) {
                dt.setText("Document Nr:\n" + tijdsregistratiekaart.taskDocumentNo_);
            }
            if (et != null) {
                et.setText("Activiteit:\n " + tijdsregistratiekaart.activity);
            }
            if (ft != null) {
                ft.setText("Begeleiding:\n " + tijdsregistratiekaart.coaching);
            }
            if (gt != null) {
                gt.setText("Externe Informatie:\n" + tijdsregistratiekaart.externalInformation);
            }
            if (ht != null) {
                ht.setText("Interne Informatie:\n " + tijdsregistratiekaart.internalInformation);
            }
            if (it != null) {
                it.setText("% Afgewerkt:\n " + tijdsregistratiekaart.percentageComplete);
            }
            if (jt != null) {
                jt.setText("Project:\n" + tijdsregistratiekaart.project);
            }
            if (kt != null) {
                kt.setText("Start uur:\n " + tijdsregistratiekaart.startTime);
            }
            if (lt != null) {
                lt.setText("Stop uur:\n " + tijdsregistratiekaart.stopTime);
            }
        }
        return v;
    }
}

but if i do it like this. it is 1 big cell with different items. and i want a different cell for each items so i can add onclickItemListeners on the ones that need one.

  • 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-31T20:21:54+00:00Added an answer on May 31, 2026 at 8:21 pm

    I got it, No need to use ListView, I’m going to use a scrollView and then add textView inside it. this is going to be a lot easier & the same result.
    example: http://android-pro.blogspot.com/2010/02/android-scrollview.html

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

Sidebar

Related Questions

I have create android listview that fill in using String array. I want to
I want to fill an array in javascript that takes all the values out
Okay all, I have a form that I want users to fill out. When
I have a ListView , which is in single-choice mode . All I want
I want to fill a map with class name and method, a unique identifier
Let's say I have a split view, and I want to fill half of
I have a for loop. Inside that loop I want to fill up an
I have three ListView widgets in the same LinearLayout . Something like this (I'm
I have a ListView (set to CHOICE_MODE_SINGLE) I have a SimpleCursorAdapter who fill my
I want to have a ListView , followed by a EdiText , folowed by

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.