android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_marginLeft=“5dip”
android:singleLine=“true”
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#ffffff" />
<TextView
android:id="@+id/date"
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_below="@+id/ll"
android:layout_marginLeft=“3dip”
android:layout_toRightOf="@+id/qcb"
android:singleLine=“true”
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#ffffff" />
<TextView
android:id="@+id/content"
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_below="@+id/date"
android:layout_gravity=“bottom”
android:layout_marginLeft=“3dip”
android:layout_toRightOf="@+id/qcb"
android:singleLine=“true”
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#5CACEE" />
短息实体类:
/Contact_Demo/src/com/suntek/contact/model/SMSBean.java
package com.suntek.contact.model;
public class SMSBean {
private String thread_id; // 线程id
private String msg_count; // 消息个数
private String msg_snippet; // 消息片段
private String address; // 地址
private Long date; // 日期
private String read; // 已读
public SMSBean(String threadId, String msgCount, String msgSnippet) {
thread_id = threadId;
msg_count = msgCount;
msg_snippet = msgSnippet;
}
public SMSBean() {
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public Long getDate() {
return date;
}
public void setDate(Long date) {
this.date = date;
}
public String getRead() {
return read;
}
public void setRead(String read) {
this.read = read;
}
public String getThread_id() {
return thread_id;
}
public void setThread_id(String threadId) {
thread_id = threadId;
}
public String getMsg_count() {
return msg_count;
}
public void setMsg_count(String msgCount) {
msg_count = msgCount;
}
public String getMsg_snippet() {
return msg_snippet;
}
public void setMsg_snippet(String msgSnippet)
{
msg_snippet = msgSnippet;
}
}
短信列表适配器:
/Contact_Demo/src/com/suntek/contact/adapter/SMSAdpter.java
package com.suntek.contact.adapter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.suntek.contact.R;
import com.suntek.contact.model.SMSBean;
/**
-
短信适配器
-
@author Administrator
*/
public class SMSAdpter extends BaseAdapter {
private LayoutInflater mInflater;
private List smsList;
private Date date;
private SimpleDateFormat sdf;
public SMS