我想使用 listview 显示 imageview 和 textview 。但是没有在 listview 中使用基本适配器。这可能使用 ArrayAdapter 吗?
final String[] menuitems = new String[] {
"Settings",
"Notifications",
"Logout"
};
int[] menuiicons = { R.drawable.logo, R.drawable.logo, R.drawable.logo };
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
mainListView = (ListView) findViewById( R.id.mainListView );
ArrayList<String> menuitemList = new ArrayList<String>();
ArrayList<Integer> menuiconsList = new ArrayList<Integer>();
listAdapter = new ArrayAdapter<String>(this, R.layout.listview_home, menuitemList);
mainListView.setAdapter( listAdapter );