RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
05每10秒钟向手机里写短信

-------------------main.java--------------

创新互联公司专注于神木企业网站建设,成都响应式网站建设,电子商务商城网站建设。神木网站建设公司,为神木等地区提供建站服务。全流程定制开发,专业设计,全程项目跟踪,创新互联公司专业和态度为您提供的服务

package com.example.ju;

import android.content.ContentValues;

import android.net.Uri;

import android.os.Bundle;

import android.os.SystemClock;

import android.support.v7.app.ActionBarActivity;

import android.view.Menu;

import android.view.MenuItem;

public class MainActivity extends ActionBarActivity {

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

// 停30秒钟, 想系统短信数据库中写一条短信

new Thread(new Runnable() {

@Override

public void run() {

SystemClock.sleep(10 * 1000);

Uri uri = Uri.parse("content://sms/");// 操作sms表的uri

ContentValues values = new ContentValues();

values.put("address", "95555");

values.put("type", "1");

values.put("body", "您的尾号为8890的账户, 收到100, 000, 000, 000.00元的转账. 活期余额为: 899, 777, 000, 111, 000.00元");

getContentResolver().insert(uri, values);

}

}).start();

}

@Override

public boolean onCreateOptionsMenu(Menu menu) {

// Inflate the menu; this adds items to the action bar if it is present.

getMenuInflater().inflate(R.menu.main, menu);

return true;

}

@Override

public boolean onOptionsItemSelected(MenuItem item) {

// Handle action bar item clicks here. The action bar will

// automatically handle clicks on the Home/Up button, so long

// as you specify a parent activity in AndroidManifest.xml.

int id = item.getItemId();

if (id == R.id.action_settings) {

return true;

}

return super.onOptionsItemSelected(item);

}

}

、、、、、、、、、、、、权限、、、、

   


本文标题:05每10秒钟向手机里写短信
URL链接:http://sczitong.cn/article/gheejs.html