您的当前位置:首页正文

android使用ExpandableListView控件实现小说目录效果的例子

2024-11-03 来源:个人技术集锦

        loadData();
    }

    private void init() {
        elv_journal_catalog = (ExpandableListView) findViewById(R.id.elv_journal_catalog);
        elv_journal_catalog.setOnChildClickListener(listener);
    }
    private void loadData() {
        Message msg = handler.obtainMessage();
        msg.what = 1;
        msg.sendToTarget();

        childrenObj = new ArrayList<List<Article>>();
        new Thread() {

            @Override
            public void run() {
                if (!isLoading) {
                    queryArticleList();
                } else {
                    queryArticleListFromSqlite();
                }
            }

        }.start();

        adapter = new JournalCatalogListAdapter(this, childrenObj);
        elv_journal_catalog.setAdapter(adapter);
    }

Top