2013-03-17 74 views
1

我可以通過手機中的網絡瀏覽器發送意向廣播嗎?可以通過Android中感興趣的廣播接收器(本機應用程序)接收該意向廣播?我可以從感興趣的廣播接收器(本地應用程序)可以接收的電話中的網絡瀏覽器發送意向廣播嗎?

+0

你是在說一個網站或者使用Web技術,如phonegab的應用程序? – 2013-03-17 08:44:29

+0

從手機瀏覽器到該手機中的Android應用程序 – Sibish 2013-03-21 02:37:58

回答

2

在HTML中使用此:

<a href="intent://my_host#Intent;scheme=my_scheme;action=my_action;end">Link to my stuff</a> 

然後把這些在清單:

<intent-filter> 
     <action android:name="android.intent.action.VIEW"/> 
     <category android:name="android.intent.category.DEFAULT" /> 
     <category android:name="android.intent.category.BROWSABLE" /> 
     <data android:scheme="my_scheme" android:host="my_host" /> 
    </intent-filter> 
+0

我們可以發送像html一樣的廣播嗎? – Sibish 2013-03-21 05:59:52

+0

Intent intent = new Intent(); intent.setAction(「de.vogella.android.mybroadcast」); sendBroadcast(intent); – Sibish 2013-03-21 06:02:22

+0

Sibish:您在網站按鈕點擊或應用程序按鈕點擊時寫入的HTML代碼? – 2015-04-29 11:36:47