答案 0 :(得分:0)
首先,在主要活动中尝试使用此代码listView = (ListView) findViewById(R.id.listview);
datamodels = new ArrayList<>();
datamodels.add(new Model(R.drawable.ic_menu_camera,"Girl",R.drawable.ic_play_arrow_black_24dp,500, 44100,R.drawable.ic_more_vert_black_24dp,false));
datamodels.add(new Model(R.drawable.ic_android_black_24dp,"Cave",R.drawable.ic_play_arrow_black_24dp,200, 500,R.drawable.ic_more_vert_black_24dp,false));
datamodels.add(new Model(R.drawable.ic_menu_gallery,"Speaker",R.drawable.ic_play_arrow_black_24dp,-9079435, 4300,R.drawable.ic_more_vert_black_24dp,false));
在此之后在您的项目中创建一个模型列表视图,之后您需要在xml中创建所需的布局。