我在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);
谢谢= D