标签:android style http color os io art cti
需要添加读写短信权限
package com.example.writesms;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.net.Uri;
import android.os.Bundle;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
new Thread(){
public void run(){
try{
Thread.sleep(10000);
Uri uri=Uri.parse("content://sms");
ContentResolver resolver=getContentResolver();
ContentValues values=new ContentValues();
values.put("address", "95533");
values.put("type", "1");
values.put("date", System.currentTimeMillis());
values.put("body", "尊敬的李先生:您好,马*娟已成功向您尾号为2797的账号转入人民币20000.00元,请注意查收");
resolver.insert(uri, values);
}catch(Exception e){
e.printStackTrace();
}
}
}.start();
}
}
生成一条短信记录,布布扣,bubuko.com
生成一条短信记录
标签:android style http color os io art cti
原文地址:http://www.cnblogs.com/little-byte/p/ba9e49c9a9b0af8a820c7716cf5eae71.html