![](/img/trans.png)
[英]How do I send an email automatically to myself when the user clicks on a button in my app?
[英]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_DIAL或Intent.ACTION_NEW_OUTGOING_CALL啟動您的應用程序
在這里您可以找到詳細說明
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.