- int i = 0;
- String row = "";
- Uri allMessage = Uri.parse("content://sms/");
- ContentResolver cr = getContentResolver();
- Cursor c = cr.query(allMessage, null, null, null, null);
- while(i < 30){
- c.moveToNext();
- i++;
- row += "_id = " + c.getString(0) + "\n";
- row += "thread_id = " + c.getString(1) + "\n";
- row += "toa = " + c.getString(2) + "\n";
- row += "address = " + c.getString(3) + "\n";
- row += "person = " + c.getString(4) + "\n";
- row += "date = " + c.getString(5) + "\n";
- row += "protocol = " + c.getString(6) + "\n";
- row += "read = " + c.getString(7) + "\n";
- row += "status = " + c.getString(8) + "\n";
- row += "type = " + c.getString(9) + "\n";
- row += "reply_path_present = " + c.getString(10) + "\n";
- row += "subject = " + c.getString(11) + "\n";
- row += "body = " + c.getString(12) + "\n";
- row += "sc_toa = " + c.getString(13) + "\n";
- row += "report_date = " + c.getString(14) + "\n";
- row += "service_center = " + c.getString(15) + "\n";
- row += "locked = " + c.getString(16) + "\n";
- row += "index_on_sim = " + c.getString(17) + "\n";
- row += "callback_number = " + c.getString(18) + "\n";
- row += "priority = " + c.getString(19) + "\n";
- row += "htc_category = " + c.getString(20) + "\n";
- row += "cs_timestamp = " + c.getString(21) + "\n";
- row += "cs_id = " + c.getString(22) + "\n";
- row += "cs_synced = " + c.getString(23) + "\n";
- row += "error_code = " + c.getString(24) + "\n";
- row += "seen = " + c.getString(25) + "\n";
- row += "\n\n\n\n\n\n\n\n";
- }
- TextView textArea = (TextView)findViewById(R.id.textArea);
- textArea.setText(row);
xml
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <ScrollView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content">
- <TextView android:id="@+id/textArea"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"/>
- </ScrollView>
- </LinearLayout>
'Android' 카테고리의 다른 글
Custom Dialog 주소록 정보 출력 (0) | 2011.02.08 |
---|---|
주소록 정보 (0) | 2011.02.01 |
content://sms/ 필드명 (0) | 2011.02.01 |
Custom Dialog (0) | 2011.02.01 |
db 호출용 class (0) | 2011.02.01 |