原文:http://kevinlynx.iteye.com/blog/843281
读取短信本身没什么难度,仅仅是读取SQLite数据库而已。
- public Uri SMS_INBOX = Uri.parse("content://sms/inbox");
- private void fillListView() {
- ListView view = (ListView) findViewById(R.id.sms_list);
- ArrayList<HashMap<String, String>> list = readAllSMS();
- SimpleAdapter listItemAdapter = new SimpleAdapter(this, list,
- android.R.layout.simple_list_item_2,
- new String[] { "addr","body"},
- new int[] {android.R.id.text1, android.R.id.text2}
- );
- view.setAdapter(listItemAdapter);
- }
- private ArrayList<HashMap<String, String>> readAllSMS() {