当前位置: 首页 > news >正文

自己建设网站用哪个全网搜索软件下载

自己建设网站用哪个,全网搜索软件下载,郑州网站 建设,网站建设与管理自考真题湖南我们可以通过设置ACTION_CALL或者ACTION_DIAL完成在Android中进行电话拨号。二者区别在于:(1)ACTION_CALL:直接拨号;(2)ACTION_DIAL:调用拨号程序,手工拨出。 一、设计界…
我们可以通过设置ACTION_CALL或者ACTION_DIAL完成在Android中进行电话拨号。
  二者区别在于:
  (1)ACTION_CALL:直接拨号;
  (2)ACTION_DIAL:调用拨号程序,手工拨出。

 

一、设计界面

  1、MainActivity布局文件

  打开res/layout/activity_main.xml文件。
  输入以下代码:

<?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" >
<TextView
android:id="@+id/tel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="请输入电话号码:" />
<EditText
android:id="@+id/telphone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10" >
<requestFocus />
</EditText>
<Button
android:id="@+id/call"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="呼叫" />
</LinearLayout>


二、程序文件

  打开“src/com.genwoxue.intenttel/MainActivity.java”文件。
  然后输入以下代码:

package com.genwoxue.intenttel;
import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
public class MainActivity extends Activity {
private TextView tvTelphone=null;
private Button btnCall=null;
@Override
public void onCreate(Bundle savedInstanceState)   
{   
super.onCreate(savedInstanceState);              
setContentView(R.layout.activity_main);
tvTelphone=(TextView)super.findViewById(R.id.telphone);
btnCall=(Button)super.findViewById(R.id.call);
btnCall.setOnClickListener(new OnClickListener(){
public void onClick(View v)
{  
String Telphone=tvTelphone.getText().toString();
Uri uri=Uri.parse("tel:"+Telphone);
Intent intent=new Intent();
intent.setAction(Intent.ACTION_CALL);
intent.setData(uri);
MainActivity.this.startActivity(intent);
}
});
}
}        	


三、配置文件

  打开“AndroidManifest.xml”文件。
  然后输入以下代码:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.genwoxue.intenttel"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.CALL_PHONE"/>

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.genwoxue.intenttel.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>
</application>
</manifest>

  注意:需要在AndroidManifest.xml文件中添加权限:

  <uses-permission android:name="android.permission.CALL_PHONE"/>

四、运行结果

    
http://www.lbrq.cn/news/2466829.html

相关文章:

  • 免费自助建站网站seo诊断技巧
  • 自己建设网站步骤百度app下载安装 官方
  • 邢台移动网站建设费用自己怎么优化网站
  • 电子商务公司设计网站建设惠州seo网站管理
  • 如何建议一个网站竞价排名点击器
  • seo是东莞企业网站排seo河南网站建设报价
  • wordpress做小说网站吗搜索引擎主要包括三个部分
  • 网站建设怎样上传程序长春刚刚最新消息今天
  • 哈尔滨站建站时间朔州seo
  • 手机移动网站模板百度app安装免费下载
  • 网站建设渠道网站seo优化网站
  • 舟山网站建设推荐网站制作企业
  • 桂林北站改造优化师培训
  • 网站建设公司 优势百度网页链接
  • 网站建设 职位如皋网站制作
  • 南昌旅游网站建设方案手机怎么建自己的网站
  • h5做网站什么软件头条新闻最新消息
  • 汽车网站策划西安网站seo技术
  • 同性做视频网站网站功能开发
  • 江苏网站建设价格全渠道营销
  • 河南省建设工程一体化平台哈尔滨网络seo公司
  • 哪个网站做批发的新站整站快速排名
  • 公司做网站有意义么整合营销活动策划方案
  • 专业上海网站建设福州seo技巧培训
  • 天津市住房建设委员会网站seo长尾关键词优化
  • 企业网站 的网络营销方法有爱站seo工具包官网
  • 专业app网站建设哪家好大数据是干什么的
  • 河南住房和城乡建设厅网站百度号码认证平台取消标记
  • 常熟网站建设自己建网站流程
  • 阿里云ecs怎么建网站百度seo工具
  • 第二十天(正则表达式与功能实际运用)
  • Franky — 边缘计算智能语音助手 / Edge‑Computing Smart Voice Assistant
  • 【前端】JavaScript文件压缩指南
  • 基于SpringBoot+Uniapp的健身饮食小程序(协同过滤算法、地图组件)
  • 力扣面试150题--在排序数组中查找元素的第一个和最后一个位置
  • dev软件开发阶段的环境代号