android ContextWrapper.getResources(ContextWrapper.java:89)
getResources()报错原因是在OnCreate方法外 无法完成Context的初始化
正确做法:
String[] names; names = new String[6]; names[0] = getResources().getString(R.string.a); names[1] = getResources().getString(R.string.b); names[2] = getResources().getString(R.string.c); names[3] = getResources().getString(R.string.d); names[4] = getResources().getString(R.string.e); names[5] = getResources().getString(R.string.f);