I have a menu structure that lists the preferred configuration items.
Visual example in the Android SDK is an example example I would like to use called ExpandableList1.java . To use the scene, I do not have to pass . Problems changing the list of a string by using The relevant parts of the code have been pasted here before we say MyExpandableListAdapter with an array of stars: The next MyExpandableListAdapter and this is the manufacturer, where the array conversion occurs: As you can see in the code snippet above, there is no problem with Here are my external loops in my mind: string [] group structure and
string [] [] children structure
groups.toArray from menu objects. The problem I have is to convert the favorite object to the array of arrays. The favorite items are the array items contained in the menu object.
@Orride Creates a public void form (bundled saved instenstate ) {Super.onCreate (SavedInstanceState); ArrayList & LT; String & gt; Favorite Menu = Men.ManualistGetformatMan FlowPath (); MAdapter = New MyExpandableListAdapter (Favorite Menuist); SetListAdapter (mAdapter); RegisterForContextMenu (getExpandableListView ()); }
Public class MyExpandableListAdapter BaseExpandableListAdapter {// Sampling data sets the extension. Children [i] include children (groups of strings []) for groups [ii]. // Private string [] group = {"people name", "dog name", "cat name", "fish names"}; Private string [] group; Private string [] [] Children = {{"Arnold", "Barry", "Chuck", "David"}, {"Ace", "Bandit", "Cha-Cha", "Deuce"}, {"Fluffy "," Snuggles "}, {" goldie "," bubbles "}}; Public My Expandable List Adapter (Arreelist & lt; String & gt; Group) {this.groups = groups.toArray (new string [groups.size ()]); }
string [] groups . My idea is to iterate over menu items, remove favorites list, and then? How do I create a dynamic array in Java, because the array sizes have been fixed so much.
Public Arrayist & lt; FavoritesObject & gt; GetFavouriteItems () {ArrayList & lt; Favorite object & gt; Favorite = new array list & lt; Favorite object & gt; (); (Menu object m: all manual lists) {if (m.isFavourite) {favouritesList.add (m.getFavouriteItems ()); }} List of Returns; For example, suppose you have a
list
menu is a
list of favorites
string [] [] children = new string [menus.size ()] []; For (int i = 0; i
Comments
Post a Comment