简体   繁体   中英

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 .

It will be good if get a complete tutorial for this as i just started android developing.

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

// 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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