在android中获取数组返回null

在android中获取数组返回null,android,arrays,null,Android,Arrays,Null,我试图访问的xml文件中有一个数组,但它返回null XML: <array name="phone"> <item>17809272426</item> <item>17809272426</item> //etc... </array> String[] phonenumber; phonenumber = getResources().getStringArray(R.array.phone)

我试图访问的xml文件中有一个数组,但它返回null

XML:

<array name="phone">
    <item>17809272426</item>
    <item>17809272426</item>
    //etc...
</array>
String[] phonenumber;
phonenumber = getResources().getStringArray(R.array.phone);
Toast callContact = Toast.makeText(getApplicationContext(), phonenumber[position], Toast.LENGTH_SHORT);
callContact.show(); //blank but it shouldn't be...
Intent contactdial = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + (phonenumber[position])));
startActivity(contactdial);
Thank=D

只需在那里再次检查您的代码,而不是使用
字符串数组