android--短信查询(3)
System.out.println("name"+name);
System.out.println("type"+type);
System.out.println("phoneNumber"+phoneNumber);
System.out.println("sms"+sms);
System.out.println("..................................");
sb.append("{");
sb.append(name+",");
sb.append(phoneNumber+",");
sb.append(sms);
sb.append("}");
if (null==sms)
sms="";
} while (cur.moveToNext());
}
else
{
sb.append("no result!");
}
return sb;
}
}
package com.shao.sms;
import android.app.Activity;
import android.database.Cursor;
import android.database.sqlite.SQLiteException;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
public class ReadSMSActivity extends Activity {
/** Called when the activity is first created. */
private static final String LOG_TAG = "Sms Query";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
super.onCreate(savedInstanceState);
TextView tv = (TextView) findViewById(R.id.text);
tv.setText("");
tv.setText(getSmsAndSendBack());
}
/**
* 读取短信
* @return
*/
public String getSmsAndSendBack()
{
String[] projection = new String[] {
"_id",
"address",
"person",
相关新闻>>
- 发表评论
-
- 最新评论 更多>>