设置导航抽屉时出错

时间:2014-05-13 20:49:49

标签: java android navigation-drawer

private String[] navMenuTitles;
private TypedArray navMenuIcons;

private ArrayList<NavDrawerItem> navDrawerItems;
private NavDrawerListAdapter adapter;

navMenuIcons = getResources().obtainTypedArray(R.array.nav_drawer_icons);

navDrawerItems = new ArrayList<NavDrawerItem>();

navDrawerItems.add(new NavDrawerItem(navMenuTitles[0], navMenuIcons.getResourceId(0, 0)));

Logcat表明问题出在最后一行,即

navDrawerItems.add(new NavDrawerItem(navMenuTitles[0], navMenuIcons.getResourceId(0, 0)));

0 个答案:

没有答案