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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:04:07+00:00 2026-05-31T14:04:07+00:00

I want to list multiple layout records in one listview. For this, I fetched

  • 0

I want to list multiple layout records in one listview. For this, I fetched my data from web service and loaded that to my custom VO class Object. Then, it was handling my two types of row data. I’m passing that to my adapter but it is not generating the custom listview data. Here is my code.

Adapter :

public class FeedsAdapter extends ArrayAdapter<VO_BaseFeedHolder> {

    VO_BaseFeedHolder                   _mBaseFeedHolder;
    ArrayList<VO_CDobFeedHolder>        _cDobHolder;
    ArrayList<VO_CRateFeedHolder>       _cRateHolder;
    final Object mLock                  = new Object();
    protected LayoutInflater            _mInflator;
    private static final int TYPE_RATING = 0;
    private static final int TYPE_DOB    = 1;

    public FeedsAdapter(Activity context, ArrayList<VO_BaseFeedHolder> mBaseFeedHolder) {
        super(context, R.layout.dashboard,mBaseFeedHolder);         

        this._mBaseFeedHolder   = mBaseFeedHolder.get(0);
        this._cDobHolder        = _mBaseFeedHolder.dobFeeds;
        this._cRateHolder       = _mBaseFeedHolder.ratingFeeds;
        this._mInflator         = context.getLayoutInflater();
    }

    static class FeedsViewHolder {

        // BIRTHDAY COMPONENTS
        public ImageView _feedIcon;
        public TextView _phrase;
        public TextView _timeStamp;
        public TextView _like;
        public TextView _protobox;
        public boolean _isRating;

    }

    @Override
    public int getCount() {
        synchronized (mLock) {

        }
        return 0;
    };

    @Override
    public int getItemViewType(int position) {
        return TYPE_DOB;
    };

    @Override
    public int getViewTypeCount() {
        return 2;       
    };

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        Log.i("IN","IN TO GETVIEW");
        View rowView = convertView;
        FeedsViewHolder fvholder = new FeedsViewHolder();
        int type     = getItemViewType(position);
        if (rowView == null) {
            switch(type) {
            case TYPE_RATING:
                rowView = _mInflator.inflate(R.layout.dashboardfrate, null);
                fvholder._feedIcon = (ImageView) rowView.findViewById(R.id.ratingpic);
                fvholder._phrase   = (TextView) rowView.findViewById(R.id.ratingphrase);
                fvholder._timeStamp= (TextView) rowView.findViewById(R.id.ratingtimestamp);
                fvholder._isRating = true;
                break;
            case TYPE_DOB:
                rowView = _mInflator.inflate(R.layout.dashboardfdob, null);
                //fvholder = new FeedsViewHolder();
                fvholder._feedIcon  = (ImageView) rowView.findViewById(R.id.birthdaypic);
                fvholder._phrase    = (TextView) rowView.findViewById(R.id.birthdayphrase);
                fvholder._like      = (TextView) rowView.findViewById(R.id.birthdaylike);
                fvholder._isRating  = false;                
                break;
            }

            rowView.setTag(fvholder);
        } else {
            fvholder = (FeedsViewHolder) rowView.getTag();
        }

        if(fvholder._isRating == false) {
            Log.i("INTO fvHolder","TRUE");
            VO_CDobFeedHolder _mdobRecord = this._cDobHolder.get(position);
            Log.i("_mDob",_mdobRecord._userid);
            fvholder._phrase.setText("The Record by "+_mdobRecord._userid);
            fvholder._like.setTag(_mdobRecord._userid);
        } else {
            VO_CRateFeedHolder _mRateRecord = this._cRateHolder.get(position);
            fvholder._phrase.setText("RATING COMMENT: "+_mRateRecord._comments);
            fvholder._timeStamp.setText(_mRateRecord._timestamp);
        }
        return rowView;
    }

}

Activity:

FeedLoader();
private void FeedLoader() {
             String[] params = new String[] {};
             try {
                this.mvoBaseFeedHolder = new FetchFeedTask().execute(params).get();
                this._collection.add(mvoBaseFeedHolder);
                setListAdapter(new FeedsAdapter(this,this._collection));
            } catch (InterruptedException e) {
                Log.i("INTURRPTED",e.toString());
            } catch (ExecutionException e) {
                Log.i("Execution",e.toString());
            }
     }

VO_BaseFeedHolderis here:

public class VO_BaseFeedHolder {

    ArrayList<VO_CDobFeedHolder> dobFeeds;
    ArrayList<VO_CRateFeedHolder> ratingFeeds;

    public VO_BaseFeedHolder(ArrayList<VO_CDobFeedHolder> _dobObject,ArrayList<VO_CRateFeedHolder> _rateObject) {
        dobFeeds        =  _dobObject;
        ratingFeeds     =  _rateObject;
    }

}

VO_CDobFeedHolder:

public class VO_CDobFeedHolder {

    String _userid, _date;

    public VO_CDobFeedHolder(String userid,String date) {
        this._userid    = userid;
        this._date      = date;
    }
}

VO_CRateFeedHolder:

public class VO_CRateFeedHolder {

    final String _userid,_projectid,_responder,_stars,_comments,_timestamp;

    public VO_CRateFeedHolder(String userid, String projectid,String responder,String stars,String comments,String timestamp) {
        this._userid = userid;
        this._projectid = projectid;
        this._responder = responder;
        this._stars = stars;
        this._comments = comments;  
        this._timestamp = timestamp;
    }

}

Can anyone let me get of this situation. Need help!

  • 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-31T14:04:08+00:00Added an answer on May 31, 2026 at 2:04 pm

    Because your

      @Override
    public int getCount() {
        synchronized (mLock) {
    
        }
        return 0;
    };
    

    is returning 0. Let’s return the number of item you need to display

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

Sidebar

Related Questions

I`v come across a need where I want to create multiple list items from
I want to list messages that received specific user from other users group by
I use a ListView with android.R.layout.simple_list_item_multiple_choice as list items. I want to sort the
I want to create a list view which contain TextViews that are built from
I have a directory containing multiple subdirectories. I want to list only those subdirectories
I want edit multiple strings at once by selection the list of strings needs
I want that list, because if something horrible happens, and I'll have to reinstall
I want to list (a sorted list) all my entries from an attribute called
I am populating the ListView from my Custom DataAdaptor. I have a layout defined
I have a select list with multiple items which I want to be able

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.