These code examples were ranked by Codota’s semantic indexing as the best open source examples for ExpandableListView getExpandableListAdapter method.
appListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() { @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { Intent shortIntent = new Intent(Intent.ACTION_MAIN); String pkgName = ((GroupInfo)parent.getExpandableListAdapter().getGroup(groupPosition)) .info.packageName; String actName = ((GroupInfo)parent.getExpandableListAdapter().getGroup(groupPosition)) .info.activities[childPosition].name; shortIntent.setClassName(pkgName, actName); completeSetCustomApp(shortIntent); mAlertDialog.dismiss(); return true; } }); Builder builder = new Builder(mParent); builder.setView(appListView); mAlertDialog = builder.create(); mAlertDialog.setTitle(mParent.getString(R.string.select_custom_activity_title)); mAlertDialog.show();
{ Log.d("DashboardListener.onGroupClick"); // Recalculate the height of the ExpandableListView regarding if the clicked group is expanded or not if(!expanded) { LayoutParams params = arg0.getLayoutParams(); int count = arg0.getExpandableListAdapter().getChildrenCount(0); params.height = (count+1)*arg1.getLayoutParams().height; arg0.setLayoutParams(params); expanded = true; } else { LayoutParams params = arg0.getLayoutParams(); params.height = arg1.getLayoutParams().height; arg0.setLayoutParams(params); expanded = false; } return false; }
protected void setUp() throws Exception { super.setUp(); mActivity = getActivity(); mListView = mActivity.getExpandableListView(); mAdapter = mListView.getExpandableListAdapter(); mListUtil = new ListUtil(mListView, getInstrumentation()); } @MediumTest public void testPreconditions() { assertNotNull(mActivity); assertNotNull(mListView); } private int expandGroup(int numChildren, boolean atLeastOneChild) { final int groupPos = mActivity.findGroupWithNumChildren(numChildren, atLeastOneChild); assertTrue("Could not find group to expand", groupPos >= 0); assertFalse("Group is already expanded", mListView.isGroupExpanded(groupPos));
protected void setUp() throws Exception { super.setUp(); mActivity = getActivity(); mListView = mActivity.getExpandableListView(); mAdapter = mListView.getExpandableListAdapter(); mListUtil = new ListUtil(mListView, getInstrumentation()); } @MediumTest public void testPreconditions() { assertNotNull(mActivity); assertNotNull(mListView); } private int expandGroup(int numChildren, boolean atLeastOneChild) { final int groupPos = mActivity.findGroupWithNumChildren(numChildren, atLeastOneChild); assertTrue("Could not find group to expand", groupPos >= 0); assertFalse("Group is already expanded", mListView.isGroupExpanded(groupPos));
appListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() { @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { Intent shortIntent = new Intent(Intent.ACTION_MAIN); String pkgName = ((GroupInfo)parent.getExpandableListAdapter().getGroup(groupPosition)) .info.packageName; String actName = ((GroupInfo)parent.getExpandableListAdapter().getGroup(groupPosition)) .info.activities[childPosition].name; shortIntent.setClassName(pkgName, actName); completeSetCustomApp(shortIntent); mAlertDialog.dismiss(); return true; } }); Builder builder = new Builder(mParent); builder.setView(appListView); mAlertDialog = builder.create(); mAlertDialog.setTitle(mParent.getString(R.string.select_custom_activity_title)); mAlertDialog.show();
appListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() { @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { Intent shortIntent = new Intent(Intent.ACTION_MAIN); String pkgName = ((GroupInfo)parent.getExpandableListAdapter().getGroup(groupPosition)) .info.packageName; String actName = ((GroupInfo)parent.getExpandableListAdapter().getGroup(groupPosition)) .info.activities[childPosition].name; shortIntent.setClassName(pkgName, actName); completeSetCustomApp(shortIntent); mAlertDialog.dismiss(); return true; } }); Builder builder = new Builder(mParent); builder.setView(appListView); mAlertDialog = builder.create(); mAlertDialog.setTitle(mParent.getString(R.string.select_custom_activity_title)); mAlertDialog.show();
appListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() { @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { Intent shortIntent = new Intent(Intent.ACTION_MAIN); String pkgName = ((GroupInfo)parent.getExpandableListAdapter().getGroup(groupPosition)) .info.packageName; String actName = ((GroupInfo)parent.getExpandableListAdapter().getGroup(groupPosition)) .info.activities[childPosition].name; shortIntent.setClassName(pkgName, actName); completeSetCustomApp(shortIntent); mAlertDialog.dismiss(); return true; } }); Builder builder = new Builder(mParent); builder.setView(appListView); mAlertDialog = builder.create(); mAlertDialog.setTitle(mParent.getString(R.string.select_custom_activity_title)); mAlertDialog.show();
appListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() { @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { Intent shortIntent = new Intent(Intent.ACTION_MAIN); String pkgName = ((GroupInfo)parent.getExpandableListAdapter().getGroup(groupPosition)) .info.packageName; String actName = ((GroupInfo)parent.getExpandableListAdapter().getGroup(groupPosition)) .info.activities[childPosition].name; shortIntent.setClassName(pkgName, actName); completeSetCustomApp(shortIntent); mAlertDialog.dismiss(); return true; } }); Builder builder = new Builder(mParent); builder.setView(appListView); mAlertDialog = builder.create(); mAlertDialog.setTitle(mParent.getString(R.string.select_custom_activity_title)); mAlertDialog.show();
appListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() { @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { Intent shortIntent = new Intent(Intent.ACTION_MAIN); String pkgName = ((GroupInfo)parent.getExpandableListAdapter().getGroup(groupPosition)) .info.packageName; String actName = ((GroupInfo)parent.getExpandableListAdapter().getGroup(groupPosition)) .info.activities[childPosition].name; shortIntent.setClassName(pkgName, actName); completeSetCustomApp(shortIntent); mAlertDialog.dismiss(); return true; } }); Builder builder = new Builder(mParent); builder.setView(appListView); mAlertDialog = builder.create(); mAlertDialog.setTitle(mParent.getString(R.string.select_custom_activity_title)); mAlertDialog.show();
appListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() { @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { Intent shortIntent = new Intent(Intent.ACTION_MAIN); String pkgName = ((GroupInfo)parent.getExpandableListAdapter().getGroup(groupPosition)) .info.packageName; String actName = ((GroupInfo)parent.getExpandableListAdapter().getGroup(groupPosition)) .info.activities[childPosition].name; shortIntent.setClassName(pkgName, actName); completeSetCustomApp(shortIntent); mAlertDialog.dismiss(); return true; } }); Builder builder = new Builder(mParent); builder.setView(appListView); mAlertDialog = builder.create(); mAlertDialog.setTitle(mParent.getString(R.string.select_custom_activity_title)); mAlertDialog.show();