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

The Archive Base Latest Questions

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

There is the following code: @Override public void showDialog(final Context context) { AlertDialog.Builder builder=new

  • 0

There is the following code:

    @Override
    public void showDialog(final Context context) {
        AlertDialog.Builder builder=new AlertDialog.Builder(context);
        LayoutInflater inflater=LayoutInflater.from(context);
        View view=inflater.inflate(R.layout.dialog_year_days, null);
        ExpandableListView list=(ExpandableListView)view.findViewById(R.id.dialogYearDaysList);
        SimpleExpandableListAdapter adapter=new 
            SimpleExpandableListAdapter(context, createGroups(), android.R.layout.simple_expandable_list_item_2, 
            new String[]{"name"}, new int[]{android.R.id.text1}, createChildren(), 
            R.layout.list_item_day_of_year, new String[]{"name"}, new int[]{R.id.listItemDayOfYearName});
        list.setAdapter(adapter);
        list.setClickable(true);
        list.setOnChildClickListener(new OnChildClickListener() {

            @Override
            public boolean onChildClick(ExpandableListView parent, View v,
                    int groupPosition, int childPosition, long id) {

                Toast.makeText(context, "123", Toast.LENGTH_LONG).show();
                return true;
            }

        });
        builder.setView(view);
        builder.setTitle("Choose days");
        builder.create().show();
    }

    public List<Map<String, ?>> createGroups() {
        List<Map<String, ?>> list = new ArrayList<Map<String, ?>>();            
        for (int i = 0; i < 12; i++) {
            Map<String, String> item = new HashMap<String, String>();
            item.put("name", DAYS[i]);
            list.add(item);
        }           
        return list;
    }

    public List<List<Map<String, ?>>> createChildren() {
        List<List<Map<String, ?>>> list = new ArrayList<List<Map<String,?>>>();
        for (int i = 0; i < 12; i++) {
            List<Map<String, ?>> itemList = new ArrayList<Map<String, ?>>();
            for (int j = 0; j < COUNT_OF_DAYS[i]; j++) {
                Map<String, Object> item = new HashMap<String, Object>();
                item.put("name", String.valueOf(j+1));
                itemList.add(item);
            }
            list.add(itemList);
        }

        return list;
    }

This code works and shows me my ExpandableListView, but there is the following problem – child items aren’t clickable! As you can see, I’ve set listener for click by child, but I’ve never seen any Toasts! How can I fix it?

UPDATE: I use my custom view for child item, but if I change it for any android.R.layout layout it will work!

  • 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-14T12:43:05+00:00Added an answer on June 14, 2026 at 12:43 pm

    Set android:focusable="false" for each view in your custom view for child item.

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

Sidebar

Related Questions

There is the following code from custom AsyncTask: @Override public void onPreExecute() { setTitle();
I have the following code class OverlayTask extends AsyncTask<Void, Void, Void> { @Override public
I have an initialized WebView with the following code: _webView.setWebViewClient(new WebViewClient() { @Override public
I have the following code: public boolean stopped = false; public void fadeOut(final ImageView
Please, explain, why in the following code there is no error: void f() {
I have been developing some Android application and there is the following code: final
In the jquery.cycle.js file, there is the following code: $.fn.cycle.transitions.scrollRight = function($cont, $slides, opts)
I have been developing the application for drawing, and there is the following code
My program/process exited abnormally? I doubt something is wrong with the following code: There
I'm reading Eckel's book, IO chapter, and there is the following code (p. 667).

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.