博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
android系统功能-----调用短信发送功能
阅读量:3936 次
发布时间:2019-05-23

本文共 869 字,大约阅读时间需要 2 分钟。

标题

系统功能-----调用短信发送功能

其他的系统功能有时间再写

layout.xml

<?xml version="1.0" encoding="utf-8"?>

main.java

package com.example.myapplication2;

import android.app.Activity;

import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends Activity {

Button btn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btn = findViewById(R.id.btn);
btn.setOnClickListener(new mClick());
}

private class mClick implements View.OnClickListener {    public void onClick(View v){        Uri uri = Uri.parse("smsto:123456789");        Intent it = new Intent(Intent.ACTION_SENDTO,uri);        it.putExtra("body","tet");        startActivity(it);    }}

}

转载地址:http://bkegn.baihongyu.com/

你可能感兴趣的文章
3.9.3 - Sorting Lists
查看>>
3.10 - Maya Commands: ls
查看>>
3.11 - Dictionaries in Python
查看>>
3.12 - Tuples in Python
查看>>
4.4 - For Loops
查看>>
4.2.2 - Logical and/or Operators
查看>>
Lesson 4 Part 2 Softmax Regression
查看>>
文章中运用到的数学公式
查看>>
Projective Dynamics: Fusing Constraint Projections for Fast Simulation
查看>>
从2D恢复出3D的数据
查看>>
glm 中 数据类型 与 原始数据(c++ 数组)之间的转换
查看>>
Derivatives of scalars, vector functions and matrices
查看>>
the jacobian matrix and the gradient matrix
查看>>
VS2010 将背景设为保护色
查看>>
ubutun里面用命令行安装软件
查看>>
ubuntu 常用命令
查看>>
SQLite Tutorial 4 : How to export SQLite file into CSV or Excel file
查看>>
how to move pivot to origin
查看>>
Optimizate objective function in matrix
查看>>
Convert polygon faces to triangles or quadrangles
查看>>