android自动拨打电话
2014-10-27 16:19
281 查看
1. Create Android Application Project
2. In MainActivity.java, add the below:
package com.example.testandroid1;
import android.app.Activity;
import android.content.Intent;
class MainActivity extends Activity {
.....
public void onButtonClick(View v)
{
Intent intent =new Intent(Intent.ACTION_CALL,Uri.parse("tel:110"));
MainActivity.this.startActivity(intent);
}
}
3. In AndroidManifest.xml, add the below. Its level is same as <uses-sdk>
<uses-permission android:name="android.permission.CALL_PHONE" />
4. Right click the project and choose Run as -> Android Device Chooser ->Choose device
2. In MainActivity.java, add the below:
package com.example.testandroid1;
import android.app.Activity;
import android.content.Intent;
class MainActivity extends Activity {
.....
public void onButtonClick(View v)
{
Intent intent =new Intent(Intent.ACTION_CALL,Uri.parse("tel:110"));
MainActivity.this.startActivity(intent);
}
}
3. In AndroidManifest.xml, add the below. Its level is same as <uses-sdk>
<uses-permission android:name="android.permission.CALL_PHONE" />
4. Right click the project and choose Run as -> Android Device Chooser ->Choose device
相关文章推荐
- Android手机拨打电话、手动发送短信与自动拨打电话、自动发送短信(代码很简单哦)
- Android 自动拨打电话
- Android4.4KK下遮盖p-sensor拨打电话无法自动灭屏的问题分析
- android 自动拨打含“#”如:*1234#的电话
- android 自动拨打电话 挂断电话代码
- Android MonkeyRunner自动拨打电话
- Android 小应用:“自动拨打电话app”制作心得
- android 自动拨打电话和挂断电话(反射和intent方式)
- android 自动拨打电话和挂断电话(反射和intent方式)
- Android-拨打电话自动添加IP地址(BroadcastReceiver)
- Android实战—实现自动读取通讯录和通话记录切换,ViewPage滑屏效果,可拨打电话
- Android 如何自动拨号+拨打电话
- Android实战简易教程-第七十三枪(拨打、接听电话自动免提)
- 使用Android拨打电话功能
- 模拟器不能拨打电话 Android.process.acore has stopped unexpectedly
- 使用Android拨打电话功能
- android 2.1 监听电话状态并自动接听来电
- Android手机开发:在程序中拨打电话
- Android弹出拨号界面和拨打电话实现
- android-基础知识:实现简单的拨打电话功能_intent_study