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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:43:25+00:00 2026-06-14T00:43:25+00:00

This is what my application looks like using expanable listview to read data from

  • 0

This is what my application looks like using expanable listview to read data from database and then displaying it, the range is for 3 month or 12 weeks! now what i want is to display only content of every week !! i dont want to display the WEEK label! for example if there is any data during this 12 weeks we will display it ( but just with day label and data description) but if not we want to display nothing!! ( not display the Weeks!) and also i want to disable the collapsing of each item.

enter image description here

this is my adapter

public class MyCareHeaderExpandableListAdapter extends MyCareExpandableListAdapter {

public MyCareHeaderExpandableListAdapter(Context context) {
    super(context);
}
//--------------------------------------------------------------------

@Override
public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
    //Log.d("getChildView", "getChildView " + groupPosition);
     //View view = adapter.getView(childPosition, convertView, parent);
    Item item = getChild(groupPosition, childPosition);
    return setContentView(R.layout.expandable_list_item, convertView, item);
}
//--------------------------------------------------------------------
@Override
public long getChildId(int groupPosition, int childPosition) {
    int id = ((ScheduleItem)m_childrens.get(groupPosition).getItem(childPosition)).getID();
    return id;
}
//--------------------------------------------------------------------

/**
 * This function is called to generate the view for the groups.
 */
public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
    String name[] = getGroup(groupPosition);

    //  Generating header
    //  A header has no child, and begins the name with "Week"
    //if (getChildrenCount(groupPosition) == 0 && (name[1] == null)) { 
    if (name[1] == null) { 
        convertView = m_inflater.inflate(R.layout.expandable_list_week, null);
        TextView textView = (TextView)convertView.findViewById(R.id.txtHeader);
        Font.setToView(textView, Font.BOLD);
        textView.setText(name[0]);
    }
    //  Generating group name
    else {
        //Log.d("getGroupView", name);
        convertView = m_inflater.inflate(R.layout.expandable_list_group, null); 
        TextView textView = (TextView)convertView.findViewById(R.id.txtDay);
        textView.setText(name[0]);
        Font.setToView(textView, Font.BOLD);

        TextView textView2 = (TextView)convertView.findViewById(R.id.txtDate);
        textView2.setText(name[1]);
        Font.setToView(textView2, Font.BOLD);
    }
    return convertView;
}
  • 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-14T00:43:26+00:00Added an answer on June 14, 2026 at 12:43 am

    Two issues you are dealing with:

    (1) don’t display group view for weeks with no entries

    For this, I suggest modifying your group cursor query such that it does not return a cursor with entries for “empty” weeks.

    (2) don’t allow users to collapse groups

    For this same purpose, I implemented the OnGroupClickListener to intercept the group clicks and essentially do nothing with it. This allows me to control when the groups are expanded or collapsed. Here my listener implementation:

    /**
     * Only purpose here is to intercept taps on the header rows and ignore them
     * (avoid expandable list view adapter from expanding/collapsing).
     */
    @Override
    public boolean onGroupClick(ExpandableListView parent, View v,
            int groupPosition, long id) {
        return true;
    } 
    

    Edit:

    To have all the groups expanded:

        int groupCount = myCursorTreeAdapter.getGroupCount();
        for (int i = 0; i < groupCount; i++) {
            myExpandableListView().expandGroup(i);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am uploading image using filedrop.js. Code in application.js file looks like this:- $(.droparea).each(function(event){
My Situation: The data request chain of my application looks like this: (Client) ->
My application architecture looks like this. GWT in the UI layer -> Calls GWT
I have a Rack application that looks like this: class Foo def initialize(app) @app
My application.js file looks like this: //= require jquery //= require jquery_ujs //= require
In our application we have a little query that looks like this: var selectedAgents
I get this error when compiling a C# application. Looks like a trivial error,
I'm working on a CodeIgniter based application. My htacess looks like this: RewriteEngine On
I have a database table that looks like this: CREATE TABLE IF NOT EXISTS
My application I have an application design that looks like this: web application layer

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.