小五贴上代码片段:
noticelistview.setonRefreshListener(new RTPullListView.OnRefreshListener() {
@Override
public void onRefresh() {
new Thread(new Runnable() {
@Override
public void run() {
try {
SQLiteDatabase db= DBHelper.getDB();
//获取网络请求返回的字符串
String resultStr = requestServerDara();
System.out.println("<<<<<<<<"+resultStr);
//读取返回的字符串
isInputStream=new ByteArrayInputStream(resultStr.getBytes());
//解析读取到的字符串
NoticeParseXML noticeParseXML = new NoticeParseXML(isInputStream);
List<Notice> list=noticeParseXML.getList();
// Cursor cursor1=db.rawQuery("select * from notice_info",null);
Cursor cursor1=db.query("notice_info", null, null, null, null, null,"id DESC");
int Id = 0;
if(cursor1.moveToPosition(0)==true){