新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Android撥號器
1、界面效果圖

創(chuàng)新互聯(lián)公司主要從事成都網(wǎng)站設(shè)計(jì)、成都做網(wǎng)站、網(wǎng)頁設(shè)計(jì)、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)定結(jié),10余年網(wǎng)站建設(shè)經(jīng)驗(yàn),價(jià)格優(yōu)惠、服務(wù)專業(yè),歡迎來電咨詢建站服務(wù):13518219792
2、AndroidManifest.xml
- package="com.tjp"
- android:versionCode="1"
- android:versionName="1.0">
- android:label="@string/app_name">
注冊電話撥打服務(wù)
3、界面代碼
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- >
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/mobilelable"
- />
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:id="@+id/mobile"/>
4、界面值定義strings.xml
請輸入手機(jī)號碼 電話撥號器 撥打
5、activity
- package com.tjp;
- import android.app.Activity;
- import android.content.Intent;
- import android.net.Uri;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.Button;
- import android.widget.EditText;
- public class PhoneActivity extends Activity {
- private EditText mobile;
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- Button btncall=(Button)this.findViewById(R.id.btncall);
- mobile=(EditText)this.findViewById(R.id.mobile);
- btncall.setOnClickListener(new View.OnClickListener(){ //匿名內(nèi)部類
- @Override
- public void onClick(View v) {
- String mobilemobileText=mobile.getText().toString();
- Intent intent=new Intent(Intent.ACTION_CALL,Uri.parse("tel:"+mobileText));//撥打電話
- startActivity(intent);
- }
- });
- }
- }
【編輯推薦】
Android智能手機(jī)操作系統(tǒng)
深入理解Android消息處理系統(tǒng)原理
在Android應(yīng)用程序中使用Internet數(shù)據(jù)
名稱欄目:Android撥號器
網(wǎng)站鏈接:http://www.dlmjj.cn/article/djodjhh.html


咨詢
建站咨詢
