Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个列表视图菜单项,我可以使用添加按钮动态添加,而不是弹出对话框菜单。
问题是,如何通过意图从所选菜单获取信息到另一个特定菜单,以便每个列表视图菜单都有不同的子菜单,可以通过选择的父菜单识别?
尝试设置一个onItemClickListener,像这样;
onItemClickListener
list.setOnItemClickListener(new AdapterView.OnItemClickListener(){ public void onItemClick(AdapterView<?> parent, View view, final int item, long id){ String item = parent.getSelectedItem(); } });