我想用取自(string.xml)和图像的文本填充列表视图。我这样做了,但我得到了 NPE 你能帮我吗?谢谢
public class Menu_activity extends ListActivity {
int[] img = { R.drawable.01, R.drawable.1, R.drawable.2,
R.drawable.3, R.drawable.4,
R.drawable.5};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getListView().setDividerHeight(1);
getListView().setAdapter(new BindDataAdapter(this, img, men));
}
private String[] men = getResources().getStringArray(R.array.men);