javaweb实现拨打电话_Android实现打电话功能

javaweb实现拨打电话_Android实现打电话功能

2023年7月13日发(作者:)

javaweb实现拨打电话_Android实现打电话功能初学安卓,⼊门的应⽤ 。打电话。新建Android 项⽬layout 控件布局 :activity_ns:tools="/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:paddingBottom="@dimen/activity_vertical_margin"android:paddingLeft="@dimen/activity_horizontal_margin"android:paddingRight="@dimen/activity_horizontal_margin"android:paddingTop="@dimen/activity_vertical_margin"tools:context=".MainActivity" >android:id="@+id/phoneview"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="@string/lable_phone" />android:id="@+id/editview"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_alignLeft="@+id/phoneview"android:layout_below="@+id/phoneview"android:layout_marginTop="14dp"android:ems="10"android:inputType="phone" >android:id="@+id/butphone"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignLeft="@+id/editview"android:layout_below="@+id/editview"android:layout_marginTop="16dp"android:text="@string/butphone" />在 ⽂件 中为其添加 打电话的 权限你会在你发现在 ⽂件 中有了⼀断这样的代码 其为打电话的 权限//设置拨打电话 的权限上⾯已经布局好 了。下⾯然后在 MainActivity 中实现其功能:public class MainActivity extends Activity {private EditText editText;private Button button_phone;@Overrideprotected void onCreate(Bundle savedInstanceState) {te(savedInstanceState);// 设置显⽰pyltsetContentView(ty_main);//获取按钮组件button_phone=(Button) findViewById(ne);//获取输⼊框组件editText = (EditText) findViewById(ew);//注册按钮事件button_lickListener(new kListener() {@Overridepublic void onClick(View v) {// TODO Auto-generated method stub//获取号码String phone_Num = t().toString();//定义执⾏打电话的意图对象Intent intent = new Intent(_CALL, ("tel:"+phone_Num));//执⾏意图ctivity(intent);//吐司的效果xt(, "正在给"+phone_Num+"打电话",_LONG).show();}});}}然后把你写好的项⽬ 发布到你的虚拟机上,Ok .

发布者:admin,转转请注明出处:http://www.yc00.com/xiaochengxu/1689217120a222421.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信