簡體   English   中英

我希望我的應用程序在用戶單擊“呼叫”按鈕時運行。 我怎樣才能做到這一點?

[英]I want my app to run when the user clicks on the call button. How can I do that?

我希望我的應用程序在用戶單擊“呼叫”按鈕時運行。
我怎樣才能做到這一點?
我嘗試在活動上添加一個意圖過濾器,但是它不起作用

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

您可以注冊BroadcastReceiver ,它將使用IntentFilter Intent.ACTION_DIALIntent.ACTION_NEW_OUTGOING_CALL啟動您的應用程序
在這里您可以找到詳細說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM