2013-08-27 2 views
1

내 앱에서 전화를 처리하려고합니다. 통화 (다이얼이 아님)가 만들어지면 활동을 시작할 수 있기를 원합니다. 그럼에도 불구하고 모든 비슷한 앱의 기본값을 지우거나 계정을 삭제하더라도 "사람"활동의 "통화"또는 전화 번호 버튼을 누르면 내 앱이 제안되지 않습니다. 코드 :이 코드가 응용 프로그램 호출을 처리하지 않는 이유는 무엇입니까?

<!-- ... --> 

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

<!-- ... --> 

<application 
    android:allowBackup="true" 
    android:icon="@drawable/ic_launcher" 
    android:label="@string/app_name" 
    android:theme="@style/AppTheme" > 
    <activity 
     android:name="com.example.contact.MainActivity" 
     android:label="@string/app_name" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
     <intent-filter> 
      <action android:name="android.intent.action.CALL" /> 
      <action android:name="android.intent.action.CALL_BUTTON" /> 
      <action android:name="android.intent.action.CALL_PRIVILEGED" /> 
      <action android:name="android.intent.action.DIAL" /> 
     </intent-filter> 
     <intent-filter> 
      <action android:name="android.intent.action.VIEW" /> 
      <action android:name="android.intent.action.DIAL" /> 

      <category android:name="android.intent.category.DEFAULT" /> 
      <category android:name="android.intent.category.BROWSABLE" /> 

      <data android:scheme="tel" /> 
     </intent-filter> 
    </activity> 
</application> 

<!-- ... --> 

같아요 나는 호출 또는 적어도 전화와 관련된 가능한 모든 의도를 잡으려고 노력하고 있어요? 그래서 무엇이 잘못 되었나요?

업데이트 : 전화 (예 : 전자 메일 응용 프로그램)에서 테이프를 찍어도 작동하지만 "사람"의 전화는 여전히 처리 할 수 ​​없습니다.

답변

0

시도해 보셨습니까?

<activity 
    android:name="com.test.Call" 
    android:label="@string/makeCall" > 
    <intent-filter> 
     <action android:name="android.intent.action.CALL" /> 
     <category android:name="android.intent.category.DEFAULT" /> 
     <action android:name="android.intent.action.CALL_PRIVILEGED" /> 
     <data android:scheme="tel" /> 
    </intent-filter> 
</activity> 
+0

나는 지금했다. 그것은 명백하게 아무것도 변경하지 않는다. – Ivan

0

항상 호출하는 앱이 실행중인 의도에 따라 다릅니다. 예를 들어, 사용자가 SMS 앱에서 전화 번호를 클릭 할 때 내 의도를 실행하고 싶습니다.

11-24 13 : 16 : 57.453 : 나는/ActivityManager가 (390) : START의 U0 {행동 = android.intent.action.VIEW 로그 캣을 살펴보면 다음과 같은 의도가 SMS 응용 프로그램에 의해 실행되는 것을 보여 주었다 DAT = 전화 : XXXXXXXXXXXXX CMP = 다음 인 텐트 필터를 추가하여

그래서 PID 2493에서/com.android.internal.app.ResolverActivity이 (엑스트라가)}, 내 SMS 앱 근무 안드로이드 :

 <intent-filter> 
      <category android:name="android.intent.category.DEFAULT" /> 
      <action android:name="android.intent.action.VIEW"/> 
      <data android:scheme="tel" /> 
     </intent-filter> 

내 충고는 단순히 LogCat을 사용하여 "인물"이 어떤 인 텐트를 기대하는지 확인하는 것입니다. 활동.

관련 문제