0
在活動中,我可以通過打電話只是得到一個字符串:如何從AndroidTestCase中的資源獲取字符串?
String myString = getString(R.string.my_string_id);
我該怎麼做在AndroidTestCase
是一回事嗎?
在活動中,我可以通過打電話只是得到一個字符串:如何從AndroidTestCase中的資源獲取字符串?
String myString = getString(R.string.my_string_id);
我該怎麼做在AndroidTestCase
是一回事嗎?
只需致電:
String myString = getContext().getString(R.string.my_string_id);
所有你需要做的是讓背景下,這是始終可用在AndroidTestCase
,並將其命名爲上。