简体   繁体   English

如何在android的expandablelistview的子菜单中添加可点击的http链接

[英]How to add clickable http link in expandablelistview's submenu in android

I want to add a download link for pdf file in expandable list view submenu: when i expand the parent and I click on one of the submenu it should open the browser or start downloading the file . 我想在可扩展列表视图子菜单中添加pdf文件的下载链接: 当我展开父级并单击其中一个子菜单时,它应该打开浏览器或开始下载文件

It will be good if get a complete tutorial for this as i just started android developing. 如果我刚刚开始进行android开发,请获取完整的教程,这将是很好的。

There are good tutorials for creating expandable list view but not what i want. 有很好的教程来创建可扩展列表视图,但不是我想要的。

kindly help me. 请帮助我。

use setOnChildClickListener to start a browser or start your downloading process 使用setOnChildClickListener启动浏览器或开始下载过程

// Listview on child click listener
    expListView.setOnChildClickListener(new OnChildClickListener() {

        @Override
        public boolean onChildClick(ExpandableListView parent, View v,
                int groupPosition, int childPosition, long id) {
            // TODO Auto-generated method stub
            Toast.makeText(getApplicationContext(),
                    listDataHeader.get(groupPosition)
                    + " : "
                    + listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition), 
                    Toast.LENGTH_SHORT).show();

        }
    });



for more details and better tutorials follow this 有关更多详细信息和更好的教程,请遵循

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM