在互联网上进行大量研究后,我找不到如何在列表视图中启用电话的答案。这是我的示例代码:假设我有 50 家医院的列表,其中包含电话联系方式
public class Medical extends ListActivity {
static final ArrayList<HashMap<String,String>> list =
new ArrayList<HashMap<String,String>>();
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.bus_main);
SimpleAdapter adapter = new SimpleAdapter(
this,
list,
R.layout.rowview,
new String[] {"title","address","phone"},
new int[] {R.id.text1,R.id.text2, R.id.text3}
);
populateList();
setListAdapter(adapter);
}
private void populateList() {
HashMap<String,String>
map = new HashMap<String,String>();
map.put("title","UHS Hospital");
map.put("address", "Street 54");
map.put("phone", "4077000");
list.add(map);
map = new HashMap<String,String>();
map.put("title","Calvary Hospital");
map.put("address", "Street 43");
map.put("phone", "2362491");
list.add(map);
}
}
如何根据医院的个人电话号码详细信息 (text3) 启用对所有列表视图条目的电话呼叫。