代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
Java
】
打电话
作者:
彧福
/ 发布于
2015/5/11
/
658
package com.example.myservice; import java.util.Calendar; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class Callphone extends Activity { private EditText edtphone; private Button btncall; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.phone); edtphone=(EditText) findViewById(R.id.edt_phone); btncall=(Button) findViewById(R.id.btnCall); btncall.setOnClickListener(new OnClickListener() { public void onClick(View v) { String number=edtphone.getText().toString().trim(); Intent intent = new Intent(Intent.ACTION_CALL,Uri.parse("tel:"+number)); startActivity(intent); } }); } } <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <EditText android:id="@+id/edt_phone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:hint="123" /> <Button android:id="@+id/btnCall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="打"/> </LinearLayout> <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.myservice" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="14" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="com.example.myservice.MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <!-- service --> <service android:name="com.example.myservice.FirstService" > </service> <!-- receive广播 --> <receiver android:name="com.example.myservice.ReceiveBroadcast"> <intent-filter> <action android:name="myaction"></action> </intent-filter> </receiver> <activity android:name="com.example.myservice.Callphone"></activity> </application> <!--添加可以向外拨打电话的权限 --> <uses-permission android:name="android.permission.CALL_PHONE"></uses-permission> </manifest>
试试其它关键字
打电话
同语言下
.
List 切割成几份 工具类
.
一行一行读取txt的内容
.
Java PDF转换成图片并输出给前台展示
.
java 多线程框架
.
double类型如果小数点后为零则显示整数否则保留两位小
.
将图片转换为Base64字符串公共类抽取
.
sqlParser 处理SQL(增删改查) 替换schema 用于多租户
.
JAVA 月份中的第几周处理 1-7属于第一周 依次类推 29-
.
java计算两个经纬度之间的距离
.
输入时间参数计算年龄
可能有用的
.
实现测量程序运行时间及cpu使用时间
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
彧福
贡献的其它代码
(
11
)
.
数字的加减乘除
.
获取json数据所有的节点路径
.
使用xlrd读取excel并返回json
.
NxN方块排序,可自动运行
.
双人贪吃蛇游戏
.
实现单链表
.
打电话
.
广播实例
.
统计多台linux的CPU使用率
.
wifi 掉线自动重连
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3