成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

Android撥號(hào)器

移動(dòng)開發(fā) Android
智能機(jī)中常用的工具,希望這篇文章能幫到你!

1、界面效果圖

 

2、AndroidManifest.xml

  1. <?xml version="1.0" encoding="utf-8"?> 
  2. <manifest xmlns:android="http://schemas.android.com/apk/res/android" 
  3.    package="com.tjp" 
  4.    android:versionCode="1" 
  5.    android:versionName="1.0"> 
  6. <uses-sdk android:minSdkVersion="7" /> 
  7. <application android:icon="@drawable/congsmall" android:label="@string/app_name"> 
  8.    <activity android:name=".PhoneActivity" 
  9.              android:label="@string/app_name"> 
  10.          <intent-filter> 
  11.         <action android:name="android.intent.action.MAIN" />   
  12.         <category android:name="android.intent.category.LAUNCHER" /> 
  13.        </intent-filter>   
  14.       </activity> 
  15.     </application>   
  16.   <uses-permission android:name="android.permission.CALL_PHONE"/> 
  17. </manifest> 

注冊(cè)電話撥打服務(wù)<uses-permission android:name="android.permission.CALL_PHONE"/>

3、界面代碼

  1. <?xml version="1.0" encoding="utf-8"?> 
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
  3.      android:orientation="vertical" 
  4.      android:layout_width="fill_parent" 
  5.      android:layout_height="fill_parent" 
  6. > 
  7. <TextView 
  8.      android:layout_width="fill_parent" 
  9.      android:layout_height="wrap_content" 
  10.      android:text="@string/mobilelable" 
  11.  /> 
  12. <EditText 
  13.      android:layout_width="fill_parent" 
  14.      android:layout_height="wrap_content" 
  15.      android:id="@+id/mobile"/><Button 
  16.      android:layout_width="wrap_content" 
  17.      android:layout_height="wrap_content" 
  18.      android:text="@string/buttonlabl" 
  19.      android:id="@+id/btncall" 
  20. /> 
  21. </LinearLayout> 

4、界面值定義strings.xml

  1. <?xml version="1.0" encoding="utf-8"?> 
  2. <resources>     
  3.     <string name="mobilelable">請(qǐng)輸入手機(jī)號(hào)碼</string>     
  4.     <string name="app_name">電話撥號(hào)器</string>      
  5.     <string name="buttonlabl">撥打</string> 
  6. </resources> 

5、activity

  1. package com.tjp;  
  2. import android.app.Activity;  
  3. import android.content.Intent;  
  4. import android.net.Uri;  
  5. import android.os.Bundle;  
  6. import android.view.View;  
  7. import android.widget.Button;  
  8. import android.widget.EditText;  
  9. public class PhoneActivity extends Activity {  
  10. private EditText mobile;  
  11. @Override  
  12. public void onCreate(Bundle savedInstanceState) {  
  13. super.onCreate(savedInstanceState);  
  14. setContentView(R.layout.main);  
  15. Button btncall=(Button)this.findViewById(R.id.btncall);  
  16. mobile=(EditText)this.findViewById(R.id.mobile);  
  17. btncall.setOnClickListener(new  View.OnClickListener(){  //匿名內(nèi)部類  
  18.   @Override  
  19.   public void onClick(View v) {   
  20.     String mobilemobileText=mobile.getText().toString();  
  21.     Intent intent=new Intent(Intent.ACTION_CALL,Uri.parse("tel:"+mobileText));//撥打電話                 
  22.     startActivity(intent);  
  23.    }  
  24.   });  
  25.  }  

【編輯推薦】

Android智能手機(jī)操作系統(tǒng)

深入理解Android消息處理系統(tǒng)原理

在Android應(yīng)用程序中使用Internet數(shù)據(jù)

責(zé)任編輯:zhaolei 來源: 網(wǎng)絡(luò)轉(zhuǎn)載
相關(guān)推薦

2010-03-16 10:32:36

Java線程撥號(hào)器

2021-08-10 09:45:49

微軟Windows 11Windows

2013-09-22 15:51:32

Android 4.4

2010-08-24 09:44:10

無線路由

2009-12-29 09:18:46

2010-04-02 16:59:40

2009-12-22 15:04:11

路由器無法撥號(hào)故障

2010-03-26 18:27:25

無線撥號(hào)路由器

2009-09-10 11:01:51

如何路由器設(shè)置自動(dòng)撥號(hào)

2011-08-15 09:51:37

路由器PPPOE拔號(hào)

2010-08-12 09:24:14

華為路由器撥號(hào)互聯(lián)

2009-12-10 17:12:58

2011-06-28 14:26:05

Opera瀏覽器

2010-04-09 14:35:03

無線路由器無法自動(dòng)撥號(hào)

2010-08-09 14:09:32

路由器互聯(lián)

2010-08-25 11:04:28

路由器故障

2009-11-10 10:43:42

2009-11-25 09:00:20

無線路由器自動(dòng)撥號(hào)

2009-12-16 14:28:56

路由器配置

2009-11-16 09:50:59

點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)

主站蜘蛛池模板: 天天操天天射天天舔 | 91精品麻豆日日躁夜夜躁 | 久久精品成人 | 中文字幕在线二区 | 最新日韩精品 | 精品欧美色视频网站在线观看 | 久久精品国产一区二区三区不卡 | 中文字幕一二三区 | 中文字幕第100页 | 91av视频在线观看 | 成人免费视频 | 亚洲欧美视频一区 | 国产亚洲精品精品国产亚洲综合 | 色999视频 | 日韩在线不卡 | 亚洲综合字幕 | 久久精品二区亚洲w码 | 一级黄色短片 | 日韩欧美成人一区二区三区 | 九九热精| 色综合99 | 亚洲精品一区二区三区蜜桃久 | 国产精品一区二区三区99 | 日韩亚洲一区二区 | 91久久精品一区二区二区 | 欧美日韩三区 | 成人在线一区二区三区 | 日日噜噜噜夜夜爽爽狠狠视频97 | 狠狠av| 日本午夜免费福利视频 | 一级片在线视频 | 亚洲精品大全 | 久久99久久99 | 午夜欧美| 波多野结衣精品 | 欧美伦理一区 | 欧美成人第一页 | 一区二区精品在线 | 欧美综合国产精品久久丁香 | 极品久久 | 久久久精品影院 |