編輯:關於Android編程
有個這樣的需求:支持在撥號界面輸入密串,暫定#*46825562*#彈出一個選擇界面,然後對這個選擇界面做出相應的處理。
因為這裡需要對系統自帶的撥號面板進行相關操作,所以必牽扯到framework層的分析。這裡我們重點是對OutgoingCallBroadcaster這個類進行分析,
然後做個小的demo演示下這個功能需求。
當我們將要打電話的時候,就需要輸入號碼,然後按撥號鍵,實際上我們是可以取得這個號碼的(這裡不管輸入的是什麼,都可以捕獲)在OutgoingCallBroadcaster這個類中的oncreate()方法有下面這幾行代碼
[java]
mPhone = PhoneApp.getInstance().phone;
Intent intent = getIntent();
if (LOGV) Log.v(TAG, "onResume: Got intent " + intent + ".");
String action = intent.getAction();
String number = PhoneNumberUtils.getNumberFromIntent(intent, this);
mPhone = PhoneApp.getInstance().phone;
Intent intent = getIntent();
if (LOGV) Log.v(TAG, "onResume: Got intent " + intent + ".");
String action = intent.getAction();
String number = PhoneNumberUtils.getNumberFromIntent(intent, this);就可以得到這個number,得到number後我們需要對其進行處理,如發送廣播“Intent.ACTION_NEW_OUTGOING_CALL”,讓別人進行處理
[java]
broadcastIntent.putExtra(EXTRA_ALREADY_CALLED, callNow);
broadcastIntent.putExtra(EXTRA_ORIGINAL_URI, intent.getData().toString());
if (LOGV) Log.v(TAG, "Broadcasting intent " + broadcastIntent + ".");
sendOrderedBroadcast(broadcastIntent, PERMISSION, null, null,
Activity.RESULT_OK, number, null);
broadcastIntent.putExtra(EXTRA_ALREADY_CALLED, callNow);
broadcastIntent.putExtra(EXTRA_ORIGINAL_URI, intent.getData().toString());
if (LOGV) Log.v(TAG, "Broadcasting intent " + broadcastIntent + ".");
sendOrderedBroadcast(broadcastIntent, PERMISSION, null, null,
Activity.RESULT_OK, number, null);發送廣播後,在OutgoingCallBroadcaster類中有一個內部類OutgoingCallReceiver,這是一個繼承了broadcastreceiver廣播的類,在它的onReceive()方法中,就是說
接收到廣播之後,從Intent裡面取出電話號碼及其URi
[java]
originalUri = intent.getStringExtra(
OutgoingCallBroadcaster.EXTRA_ORIGINAL_URI);
originalUri = intent.getStringExtra(
OutgoingCallBroadcaster.EXTRA_ORIGINAL_URI);這個時候就可以將InCallScreen啟動
[java] view plaincopyprint?
Intent newIntent = new Intent(Intent.ACTION_CALL, uri);
newIntent.putExtra(Intent.EXTRA_PHONE_NUMBER, number);
newIntent.setClass(context, InCallScreen.class);
newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(newIntent);
Intent newIntent = new Intent(Intent.ACTION_CALL, uri);
newIntent.putExtra(Intent.EXTRA_PHONE_NUMBER, number);
newIntent.setClass(context, InCallScreen.class);
newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(newIntent);
基於上面的源碼分析後,我們這時候可以思考,為什麼不采用相應的方式,在InCallScreen界面之前調用我們自己需要的界面,而屏蔽InCallScreen界面呢?這個OutgoingCallBroadcaster的oncreate()方法不需要我們外部關心,它自己會調用,我們關心的就是自己在外部寫一個廣播以及我們需要的業務界面。
下面我們就做這樣一個小的demo
1、新建一個廣播
[java]
package com.huawei.test;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
// 支持在撥號界面輸入密串,暫定 <span style="background-color: rgb(255, 255, 255); ">#*46825562*# 彈出天天聊調試功呢個選擇界面</span>
public class TransferToDebugMode extends BroadcastReceiver{
private static final String TAG = "TransferToDebugMode" ;
private static final String ACTION_DEBUGMODE = "com.huawei.test.DebugModeActivity" ;
//是否開啟Debug模式開關的開關值,默認值為true,可以在系統級別變量裡設計
private boolean isNeedDebugModeOpen = true ;
//需要設計為系統變量
private final String DebugModeOpenCode = "#*46825562*#" ;
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_NEW_OUTGOING_CALL)) {
String number = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER) ;
Log.v(TAG, "Received intent " + intent + "(number = " + number + ".") ;
if (isNeedDebugModeOpen && number.equals(DebugModeOpenCode)) {
Intent newIntent = new Intent(ACTION_DEBUGMODE) ;
newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) ;
context.startActivity(newIntent) ;
setResultData(null) ;//這一步很關鍵,啟動activity後將廣播的數據清空
}
}
}
}
package com.huawei.test;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
// 支持在撥號界面輸入密串,暫定 <span style="background-color: rgb(255, 255, 255); ">#*46825562*# 彈出天天聊調試功呢個選擇界面</span>
public class TransferToDebugMode extends BroadcastReceiver{
private static final String TAG = "TransferToDebugMode" ;
private static final String ACTION_DEBUGMODE = "com.huawei.test.DebugModeActivity" ;
//是否開啟Debug模式開關的開關值,默認值為true,可以在系統級別變量裡設計
private boolean isNeedDebugModeOpen = true ;
//需要設計為系統變量
private final String DebugModeOpenCode = "#*46825562*#" ;
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_NEW_OUTGOING_CALL)) {
String number = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER) ;
Log.v(TAG, "Received intent " + intent + "(number = " + number + ".") ;
if (isNeedDebugModeOpen && number.equals(DebugModeOpenCode)) {
Intent newIntent = new Intent(ACTION_DEBUGMODE) ;
newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) ;
context.startActivity(newIntent) ;
setResultData(null) ;//這一步很關鍵,啟動activity後將廣播的數據清空
}
}
}
}
在framework層的OutgoingCallBroadcaster的oncreate()方法已經發送了廣播(前面已經分析),這個時候我們這個廣播的onreceive()方法執行
通過判斷注冊的action和取得的number然後通過intent啟動到我們的業務界面(com.huawei.test.DebugModeActivity)
2、實現這個DebugModeActivity
[java]
package com.huawei.test;
import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RelativeLayout;
//這裡根據系統需要,看看是否要繼承HotalkActivity 或實現其他系統所需要接口
public class DebugModeActivity extends Activity implements View.OnClickListener{
private final String TAG = "DebugModeActivity" ;
private RelativeLayout logSetting , smsLogSetting;
private Button submit, cancle ;
//進度欄,可以選擇不要
private ProgressDialog pgsDialog ;
//開啟開關,默認值為fals
private boolean isNeedRecord = false ;
private boolean isSmsNeedMonitor = false ;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.debug_mode_layout) ;
initView() ;
addListener() ;
}
//界面初始化
private void initView() {
//
logSetting = (RelativeLayout)findViewById(R.id.log_setting) ;
//
smsLogSetting = (RelativeLayout)findViewById(R.id.sms_log_setting) ;
//
submit = (Button)findViewById(R.id.debug_mode_layout_submit) ;
//
cancle = (Button)findViewById(R.id.debug_mode_layout_cancle) ;
}
//注冊監聽
private void addListener() {
logSetting.setOnClickListener(this) ;
smsLogSetting.setOnClickListener(this) ;
submit.setOnClickListener(this) ;
cancle.setOnClickListener(this) ;
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.log_setting:
isNeedRecord = true ;
case R.id.sms_log_setting:
isSmsNeedMonitor = true ;
case R.id.debug_mode_layout_submit:
//
// //顯示進度條
showProgressDialog() ;
//
// //確定 開啟日志
// ServerInfo.LOG_ENABLE_ON_RELEASE = isNeedRecord ;
// LogX.refreshNeedRecord() ;
//
// //
// LoginInfo.setMessageMonitorOpen(isSmsNeedMonitor) ;
//取消 這狀態都為false
case R.id.debug_mode_layout_cancle:
isNeedRecord = false ;
isSmsNeedMonitor=false ;
break;
default:
break;
}
}
@Override
protected void onDestroy() {
super.onDestroy();
pgsDialog.dismiss() ;
}
private void showProgressDialog() {
pgsDialog = new ProgressDialog(DebugModeActivity.this);
pgsDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
pgsDialog.setMessage("您呢....");
pgsDialog.show();
}
}
package com.huawei.test;
import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RelativeLayout;
//這裡根據系統需要,看看是否要繼承HotalkActivity 或實現其他系統所需要接口
public class DebugModeActivity extends Activity implements View.OnClickListener{
private final String TAG = "DebugModeActivity" ;
private RelativeLayout logSetting , smsLogSetting;
private Button submit, cancle ;
//進度欄,可以選擇不要
private ProgressDialog pgsDialog ;
//開啟開關,默認值為fals
private boolean isNeedRecord = false ;
private boolean isSmsNeedMonitor = false ;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.debug_mode_layout) ;
initView() ;
addListener() ;
}
//界面初始化
private void initView() {
//
logSetting = (RelativeLayout)findViewById(R.id.log_setting) ;
//
smsLogSetting = (RelativeLayout)findViewById(R.id.sms_log_setting) ;
//
submit = (Button)findViewById(R.id.debug_mode_layout_submit) ;
//
cancle = (Button)findViewById(R.id.debug_mode_layout_cancle) ;
}
//注冊監聽
private void addListener() {
logSetting.setOnClickListener(this) ;
smsLogSetting.setOnClickListener(this) ;
submit.setOnClickListener(this) ;
cancle.setOnClickListener(this) ;
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.log_setting:
isNeedRecord = true ;
case R.id.sms_log_setting:
isSmsNeedMonitor = true ;
case R.id.debug_mode_layout_submit:
//
// //顯示進度條
showProgressDialog() ;
//
// //確定 開啟日志
// ServerInfo.LOG_ENABLE_ON_RELEASE = isNeedRecord ;
// LogX.refreshNeedRecord() ;
//
// //
// LoginInfo.setMessageMonitorOpen(isSmsNeedMonitor) ;
//取消 這狀態都為false
case R.id.debug_mode_layout_cancle:
isNeedRecord = false ;
isSmsNeedMonitor=false ;
break;
default:
break;
}
}
@Override
protected void onDestroy() {
super.onDestroy();
pgsDialog.dismiss() ;
}
private void showProgressDialog() {
pgsDialog = new ProgressDialog(DebugModeActivity.this);
pgsDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
pgsDialog.setMessage("您呢....");
pgsDialog.show();
}
}
3、實現這個布局
[html]
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/card_setting_group" android:layout_height="fill_parent" android:orientation="vertical" android:layout_width="wrap_content">
<RelativeLayout
android:id="@+id/title_layout"
android:layout_width="fill_parent"
android:layout_height="46dip"
android:visibility="visible"
android:background="@drawable/bg_top_bar">
<ImageView
android:id="@+id/debug_hotalk_back_line"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginLeft="16dp"
android:src="@drawable/qa_button_left"
android:visibility="gone"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="6dip"
android:singleLine="true"
style="@style/title_style"
android:layout_toRightOf="@+id/debug_hotalk_back"
android:text="Debug Mode Setting"/>
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:orientation="vertical"
android:paddingLeft="10dip"
android:paddingRight="10dip"
android:layout_height="fill_parent">
<!-- Debug 模式設置 -->
<RelativeLayout
android:layout_width="fill_parent"
android:layout_marginBottom="2dip"
android:layout_height="wrap_content"
android:layout_marginTop="12dip">
<TextView
android:id="@+id/TextView02"
android:layout_alignParentLeft="true"
android:text="日志設置"
android:layout_marginLeft="12dip"
style="@style/setting_item_title_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:background="@drawable/setting_list_bg"
android:layout_height="wrap_content">
<!-- 設置日志是否開啟 -->
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="54dip"
android:id="@+id/log_setting"
android:background="@drawable/settings_item_top_selector">
<RelativeLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginTop="8dip"
android:layout_marginBottom="8dip"
android:duplicateParentState="true"
android:layout_centerVertical="true"
>
<TextView
android:id="@+id/log_seting_name"
android:text="開啟日志"
android:maxWidth="250dip"
style="@style/setting_item_function_style"
android:duplicateParentState="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
<TextView
android:id="@+id/phoneNum"
android:maxWidth="250dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:duplicateParentState="true"
style="@style/setting_item_function_style_small"
android:layout_below="@id/log_seting_name"
/>
</RelativeLayout>
<ImageView
android:id="@+id/img_log_open"
android:layout_width="wrap_content"
android:src="@drawable/ico_choose"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:duplicateParentState="true"
android:layout_marginRight="20dip"
android:layout_centerVertical="true" >
</ImageView>
</RelativeLayout>
<!-- 分隔線 -->
<View
android:id="@+id/setting_setting_line"
android:layout_width="fill_parent"
android:layout_height="1.5dip"
android:background="@drawable/list_fengexian"
android:layout_centerVertical="true"/>
<!-- 設置短信日志是否開啟 -->
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/log_setting"
android:minHeight="54dip"
android:id="@+id/sms_log_setting"
android:background="@drawable/settings_item_top_selector">
<RelativeLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginTop="8dip"
android:layout_marginBottom="8dip"
android:duplicateParentState="true"
android:layout_centerVertical="true"
>
<TextView
android:id="@+id/sms_log_setting_name"
android:text="開啟短信日志"
android:maxWidth="250dip"
style="@style/setting_item_function_style"
android:duplicateParentState="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
<TextView
android:id="@+id/sms_phoneNum"
android:maxWidth="250dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:duplicateParentState="true"
style="@style/setting_item_function_style_small"
android:layout_below="@id/sms_log_setting_name"
/>
</RelativeLayout>
<ImageView
android:id="@+id/img_open_sms_log"
android:layout_width="wrap_content"
android:src="@drawable/ico_choose"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:duplicateParentState="true"
android:layout_marginRight="20dip"
android:layout_centerVertical="true" >
</ImageView>
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:orientation="vertical"
android:weightSum="1" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="50dip"
android:layout_marginTop="15dip"
android:padding="10dp"
android:gravity="center" >
<Button
android:id="@+id/debug_mode_layout_submit"
style="@style/invite_cancel_button_style"
android:layout_width="95dip"
android:layout_height="36dip"
android:layout_marginRight="45dip"
android:background="@drawable/cancle_button"
android:text="確定" >
</Button>
<Button
android:id="@+id/debug_mode_layout_cancle"
style="@style/invite_cancel_button_style"
android:layout_width="95dip"
android:layout_height="36dip"
android:background="@drawable/cancle_button"
android:text="取消" >
</Button>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/card_setting_group" android:layout_height="fill_parent" android:orientation="vertical" android:layout_width="wrap_content">
<RelativeLayout
android:id="@+id/title_layout"
android:layout_width="fill_parent"
android:layout_height="46dip"
android:visibility="visible"
android:background="@drawable/bg_top_bar">
<ImageView
android:id="@+id/debug_hotalk_back_line"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginLeft="16dp"
android:src="@drawable/qa_button_left"
android:visibility="gone"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="6dip"
android:singleLine="true"
style="@style/title_style"
android:layout_toRightOf="@+id/debug_hotalk_back"
android:text="Debug Mode Setting"/>
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:orientation="vertical"
android:paddingLeft="10dip"
android:paddingRight="10dip"
android:layout_height="fill_parent">
<!-- Debug 模式設置 -->
<RelativeLayout
android:layout_width="fill_parent"
android:layout_marginBottom="2dip"
android:layout_height="wrap_content"
android:layout_marginTop="12dip">
<TextView
android:id="@+id/TextView02"
android:layout_alignParentLeft="true"
android:text="日志設置"
android:layout_marginLeft="12dip"
style="@style/setting_item_title_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:background="@drawable/setting_list_bg"
android:layout_height="wrap_content">
<!-- 設置日志是否開啟 -->
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="54dip"
android:id="@+id/log_setting"
android:background="@drawable/settings_item_top_selector">
<RelativeLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginTop="8dip"
android:layout_marginBottom="8dip"
android:duplicateParentState="true"
android:layout_centerVertical="true"
>
<TextView
android:id="@+id/log_seting_name"
android:text="開啟日志"
android:maxWidth="250dip"
style="@style/setting_item_function_style"
android:duplicateParentState="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
<TextView
android:id="@+id/phoneNum"
android:maxWidth="250dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:duplicateParentState="true"
style="@style/setting_item_function_style_small"
android:layout_below="@id/log_seting_name"
/>
</RelativeLayout>
<ImageView
android:id="@+id/img_log_open"
android:layout_width="wrap_content"
android:src="@drawable/ico_choose"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:duplicateParentState="true"
android:layout_marginRight="20dip"
android:layout_centerVertical="true" >
</ImageView>
</RelativeLayout>
<!-- 分隔線 -->
<View
android:id="@+id/setting_setting_line"
android:layout_width="fill_parent"
android:layout_height="1.5dip"
android:background="@drawable/list_fengexian"
android:layout_centerVertical="true"/>
<!-- 設置短信日志是否開啟 -->
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/log_setting"
android:minHeight="54dip"
android:id="@+id/sms_log_setting"
android:background="@drawable/settings_item_top_selector">
<RelativeLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginTop="8dip"
android:layout_marginBottom="8dip"
android:duplicateParentState="true"
android:layout_centerVertical="true"
>
<TextView
android:id="@+id/sms_log_setting_name"
android:text="開啟短信日志"
android:maxWidth="250dip"
style="@style/setting_item_function_style"
android:duplicateParentState="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
<TextView
android:id="@+id/sms_phoneNum"
android:maxWidth="250dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:duplicateParentState="true"
style="@style/setting_item_function_style_small"
android:layout_below="@id/sms_log_setting_name"
/>
</RelativeLayout>
<ImageView
android:id="@+id/img_open_sms_log"
android:layout_width="wrap_content"
android:src="@drawable/ico_choose"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:duplicateParentState="true"
android:layout_marginRight="20dip"
android:layout_centerVertical="true" >
</ImageView>
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:orientation="vertical"
android:weightSum="1" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="50dip"
android:layout_marginTop="15dip"
android:padding="10dp"
android:gravity="center" >
<Button
android:id="@+id/debug_mode_layout_submit"
style="@style/invite_cancel_button_style"
android:layout_width="95dip"
android:layout_height="36dip"
android:layout_marginRight="45dip"
android:background="@drawable/cancle_button"
android:text="確定" >
</Button>
<Button
android:id="@+id/debug_mode_layout_cancle"
style="@style/invite_cancel_button_style"
android:layout_width="95dip"
android:layout_height="36dip"
android:background="@drawable/cancle_button"
android:text="取消" >
</Button>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
4、在menifest中做組件注冊以及權限等相關操作
[html]
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.huawei.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:enabled="true">
<activity android:name="com.huawei.test.DebugModeActivity">
<intent-filter >
<action android:name="com.huawei.test.DebugModeActivity"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<receiver android:name="com.huawei.test.TransferToDebugMode" >
<intent-filter android:priority="0">
<action android:name="android.intent.action.NEW_OUTGOING_CALL"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</receiver>
</application>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.huawei.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:enabled="true">
<activity android:name="com.huawei.test.DebugModeActivity">
<intent-filter >
<action android:name="com.huawei.test.DebugModeActivity"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity> www.2cto.com
<receiver android:name="com.huawei.test.TransferToDebugMode" >
<intent-filter android:priority="0">
<action android:name="android.intent.action.NEW_OUTGOING_CALL"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</receiver>
</application>
</manifest>
作者:jindegegesun我覺得android中的事件分發機制的懵懂期應該是Listview中對於item的點擊和長按事件,那個時候知道item的長按事件是返回boolean值的方法,我們知道要把
Android 虛化圖片 模糊圖片 圖片毛玻璃效果。 效果如圖: 在Android可以用RenderScript方便的實現這個方法: private void blu
ListView我們一直都在用,只不過當Adapter中的內容比較多的時候我們有時候沒辦法去設置一些組件,舉個例子:可以看到京東的故事裡面的這樣一個布局,這個布局可以說是
Launching ???? has encountered a problem. Cannot connecto to VMSocket operatio