jjzjj

groupPosition

全部标签

android - Android 中的 ExpandableLists,我想一次只允许扩展一个父列表

我只想一次展开父列表中的一项,目前我的onCreate代码如下。(按我的意愿工作,但是一次只允许一个父打开的方法不起作用)publicvoidonCreate(BundlesavedInstanceState){try{super.onCreate(savedInstanceState);setContentView(R.layout.main);finalSimpleExpandableListAdapterexpListAdapter=newSimpleExpandableListAdapter(//FORLEVEL1SCREENthis,createGroupList(),//M

android - 展开多级 ExpandableListView 的问题

我有一个多级(3级,根->父级->子级)ExpandableListView,其中包含也是ExpandableListView的子级。我没有问题把它们填满;但是,当我第一次显示Activity(onCreate)时,我需要在Parent级别展开特定项目。我成功展开了Parent的相关Root项,但我似乎无法展开Parent项。调用了给定的监听器,但结果并未反射(reflect)在我的多级列表中。我称之为扩展的Activity:publicclassActivity{privateintgroupToExpand=4,childToExpand=3;protectedvoidonCrea

android - 使用 onGroupExpand 获取 ExpandableListView 的扩展组 View

我正在使用ExpandableListView并且我在扩展组时尝试移动图像失败(图像是组View的一部分)。这是我的代码:my_list_view.setOnGroupExpandListener(newOnGroupExpandListener(){@OverridepublicvoidonGroupExpand(intgroupPosition){Toast.makeText(getBaseContext(),"Group"+my_list_view.getGroupId(groupPosition),Toast.LENGTH_SHORT).show();}});基本上我的问题是:

android - ExpandableListAdapter onClickListener,调用notifyDataSetChanged()

我有一个自定义适配器,它使用onclickListener来更改父文本,我不知道如何让notifyDataSetChanged方法在适配器中工作。应该发生的是我有一个可扩展的View,当您单击子项中的按钮时,它会用子项的文本更新父项...这是应该发生的事情的图片示例。在点击按钮之前使用这个:点击按钮后使用这个:“选择成分”更改为“米饭、杯子”或点击的任何内容所以在我显示的代码中,单击按钮后它应该更新父级,然后刷新View,但出于某种原因我不能这样做?这是我的代码,提前致谢!packagecom.example.andrew.mypantry;importandroid.content.

Android:抽屉导航内有 2 个或更多 ExpandableListView

我怎么能做这样的事情?抽屉导航内的两个可扩展ListView。我试图将它添加到我的xml中,但没有成功。我想要的是只有一个滚动条的View,但我不知道该怎么做..这是我的抽屉式导航布局:编辑:我想在Gmail应用程序中创建类似抽屉的东西 最佳答案 我终于明白了!这是我创建的代码,用于获取带有部分标题的ExpandableListView。现在我可以轻松地为标题、组和子项创建三个xml自定义布局。它对我有用,但我接受任何代码改进以优化内存使用、速度等。//----------------------------------------

java - 如何在android中的ExpandableListView中添加三级ListView

我想在ExpandableListView中再添加一层。在当前的ExpandableListView中是两层,我如何再添加一层。我是android开发的新手,请帮助我。提前致谢!我的MainActivity.java:-privateToolbarmToolbar;ExpandableListAdapterlistAdapter;ExpandableListViewexpListView;ListlistDataHeader;HashMap>listDataChild;//privateFragmentDrawerdrawerFragment;ArrayListarraylist1,a

android - ExpandableListView OnChildClickListener 不起作用

我的Android应用程序上的可扩展ListView有问题这是我的代码packageproyek.akhir;importandroid.app.ListActivity;importandroid.content.Intent;importandroid.os.Bundle;importandroid.view.View;importandroid.widget.AdapterView;importandroid.widget.ArrayAdapter;importandroid.widget.ListView;importandroid.widget.TextView;import

android - ExpandableListView OnChildClickListener 不起作用

我的Android应用程序上的可扩展ListView有问题这是我的代码packageproyek.akhir;importandroid.app.ListActivity;importandroid.content.Intent;importandroid.os.Bundle;importandroid.view.View;importandroid.widget.AdapterView;importandroid.widget.ArrayAdapter;importandroid.widget.ListView;importandroid.widget.TextView;import

android - 如何显示超过 3 级的可扩展 ListView ?

如何显示多于3级的可扩展ListView,我只获取3级可扩展的示例。引用这个:three-level-expandable-list在此示例中,他在ParentLevelBaseExpandableListAdapter的getChildView方法中添加了一个可扩展列表:CustExpListviewSecondLevelexplv=newCustExpListview(Home.this);SecondLevelexplv.setAdapter(newSecondLevelAdapter());SecondLevelexplv.setGroupIndicator(null);ret

android - 如何显示超过 3 级的可扩展 ListView ?

如何显示多于3级的可扩展ListView,我只获取3级可扩展的示例。引用这个:three-level-expandable-list在此示例中,他在ParentLevelBaseExpandableListAdapter的getChildView方法中添加了一个可扩展列表:CustExpListviewSecondLevelexplv=newCustExpListview(Home.this);SecondLevelexplv.setAdapter(newSecondLevelAdapter());SecondLevelexplv.setGroupIndicator(null);ret