我有一個微調和一個單獨的字符串數組與五個數字。微調onSelectedItem字符串?
這是字符串數組:
<resources>
<string-array name="numbers">
<item>10001</item>
<item>10002</item>
<item>10003</item>
<item>10004</item>
<item>10005</item>
</string-array>
當我選擇一個微調的項目,我想的是,選擇微調項引用從字符串數組中的一個號碼。
例子:
微調選擇的項目是「鮑勃」,他的號碼是10002 我想要得到的微調選擇一個字符串,這樣我就可以再使用它。
爲串還用法:
String phoneNo = *number from the String-Array*
try {
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(phoneNo, null, message, null, null);
添加您現在的代碼。鮑勃與這個號碼有什麼關係?它是否在某個對象的某個對象中? – 2015-02-06 19:58:29
鮑勃是在自己的字符串數組,用於微調。我需要把鮑勃與他的電話號碼聯繫起來。數字在單獨的字符串數組中。 – 2015-02-06 20:03:02