我有四个长度相同的数组(比如array1,array2 ....array4),我想将这些数组的值动态传递给,example array
以便我可以添加条件并相应地获取值。我怎么做?
public SectionListItem[] exampleArray = { // Comment to prevent re-format
new SectionListItem("array1 data","array2 data","array3 data", "array4 data")
};
private StandardArrayAdapter arrayAdapter;
private SectionListAdapter sectionAdapter;
private SectionListView listView;
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
arrayAdapter = new StandardArrayAdapter(this, R.id.example_text_view, exampleArray);
sectionAdapter = new SectionListAdapter(getLayoutInflater(), arrayAdapter);
listView = (SectionListView) findViewById(android.R.id.list);
setListAdapter(sectionAdapter);
listView.setAdapter(sectionAdapter);
}