美文网首页
省市三级联动

省市三级联动

作者: 逝水了无痕 | 来源:发表于2016-09-06 20:37 被阅读109次

//省市三级联动
protected void showPopWindow() {
opWindow.setPicker(provinceLists, cityLists, districtLists, true);
opWindow.setSelectOptions(0);
opWindow.setCyclic(false);
opWindow.showAtLocation(getWindow().getDecorView(), Gravity.BOTTOM, 0, 0); // 位置
opWindow.setOnoptionsSelectListener(new OptionsPopupWindow.OnOptionsSelectListener() {

        @Override
        public void onOptionsSelect(int options1, int option2, int options3) {
            provinces = provinceLists.get(options1);
            cities = cityLists.get(options1).get(option2);
            areas = districtLists.get(options1).get(option2).get(options3);
            locationAreaTxt.setText(provinceLists.get(options1) + "  " + cityLists.get(options1).get(option2)
                    + "  " + districtLists.get(options1).get(option2).get(options3));
        }
    });
}

相关文章

网友评论

      本文标题:省市三级联动

      本文链接:https://www.haomeiwen.com/subject/uksdettx.html