我有以下代码:
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
mSelectedContact = (NameOfList)parent.getItemAtPosition(position);
if(mSelectedContact != null){
String dn = mSelectedContact.getDisplayName();
// Talking about this line here:
String num = (mSelectedContact.getPhoneNumbers().toString());
Log.i(TAG, dn + num);
setContentView(R.layout.main1);
LinearLayout mainLayout = (LinearLayout)findViewById(R.id.main_layout_id);
LinearLayout Details = (LinearLayout)getLayoutInflater().inflate(R.layout.layout_item, null);
TextView DisplayName = (TextView)Details.findViewById(R.id.contactsListView);
DisplayName.setText((dn) + (num));
mainLayout.addView(Details);
}
}
};
我希望标记的行显示电话号码的值,但它显示光标位置,如:
John Doe[android@40598908, android@40598800]
我将如何获得数字的价值?